a micro-messaging bot to organize using public transport without having to pay.
Go to file
2017-07-19 12:17:15 +02:00
appkeys implement basic auto-reblogging 2017-06-17 18:15:13 +02:00
blacklists extended sleep time 2017-06-25 21:51:19 +02:00
goodlists change goodlist to regex patterns 2017-06-25 21:12:26 +02:00
.gitignore updated readme to prioritize tasks 2017-06-23 22:09:56 +02:00
README.md improve docs & error messages 2017-07-11 21:51:37 +02:00
retootbot.py make toot->tweet format nicer 2017-07-11 23:50:55 +02:00
retweetbot.py fixed Rate limit exceeded Error 2017-07-19 12:17:15 +02:00
ticketfrei.cfg.example reworked setup guide 2017-07-11 20:49:36 +02:00
ticketfrei.py further increase delay to avoid hitting twitter rate limit 2017-07-12 00:12:26 +02:00
trigger.py retweetbot worx again! 2017-06-25 23:50:58 +02:00

Ticketfrei micro messaging bot

The functionality is simple: it retweets every tweet where it is mentioned.

This leads to a community which evolves around it; if you see ticket controllers, you tweet their location and mention the bot. The bot then retweets your tweet and others can read the info and think twice if they want to buy a ticket. If enough people, a critical mass, participate for the bot to become reliable, you have positive self-reinforcing dynamics.

There is one security hole: people could start mentioning the bot with useless information, turning it into a spammer. That's why it has to be maintained; if someone spams the bot, mute them and undo the retweet. So it won't retweet their future tweets and the useless retweet is deleted if someone tries to check if something was retweeted in the last hour or something.

Install

Install python and virtualenv with your favourite package manager. Create and activate virtualenv

$ virtualenv -p python2 .
$ . bin/activate

Install dependencies

$ pip install python-twitter pytoml requests Mastodon.py

Configure

$ cp ticketfrei.cfg.example ticketfrei.cfg
$ vim ticketfrei.cfg

Edit the account credentials, so your bot can use your accounts.

Also add the words to the goodlist, which you want to require. A tweet is only retweeted, if it contains at least one of them. If you want to RT everything, just add your account name.

There is also a blacklist, which you can use to automatically sort out malicious tweets. Be careful though, our filter can't read the intention with which a word was used. Maybe you wanted it there.

Note that atm the good- & blacklist are still outside of ticketfrei.cfg, in separate files. we will repare this soon.

ideas

  • You can only use the twitter API if you have confirmed a phone number and sacrificed a penguin in a blood ritual. So we should build it in a way that it uses the twitter web GUI. It's difficult, but maybe it works. We had another twitter bot that worked similarly, years ago: https://github.com/b3yond/twitter-bot
  • Make it for mastodon instead of twitter. Mastodon has an open API, that's way more fun. Also mastodon may profit from the network effects though it may be hard to reach the critical mass if you can only use mastodon users.
  • Bridge to mastodon, so people can use both platforms. Easier to reach the critical mass. But could be hard to do without the twitter API.
  • Build a tool that deletes wrong toots/tweets on both platforms, would work nicely with a web UI.
  • write the muted people to the db, to easily undo the mutes if necessary.

to do

Desktop/pycharm-community-2017.1.4/bin/pycharm.sh

  • Twitter: Crawl mentions
  • Mastodon: Crawl mentions
  • Write toots/tweets to database/log
  • Twitter: retweet people
  • Mastodon: boost people
  • Twitter: access the API
  • Web UI that lets you easily delete toots/tweets per db id and mute the tweet author
  • Write Bots as Classes to be easier implemented
  • Create extra Class for the filter
  • Put as much as possible into ticketfrei.cfg
  • Make both bots run on their own and next to each other
    • implement trigger class in retootbot
    • read config in retweetbot
  • put shutdown contact in ticketfrei.cfg