A small, annoying twitter bot
The bot searches twitter for a certain search term. He replies to each of the resulting tweets with a specified reply. That's all.
- Clone this repository onto your machine
mv config.yaml.example config.yaml
- Create a new twitter user. This user will be your bot.
- Register a new app for your bot-user. Grant it read and write access and create the request keys for this user.
- Edit config.yaml, paste the four OAuth-Keys in the oauth section.
- Edit the searchterm and the reply. You don't need to worry about since_id, it is used by the bot to avoid double replies to a tweet.
- Install the twitter gem.
gem install twitter
- Test the Script. Make sure, there are tweets the bot can reply to (search for the searchterm in your desktop twitter app).
chmod +x replybot.rband then
./replybot.rb. If the prompt returns after a while without any output, the bot was successful.
- Check the bot's timeline, if all tweets are displayed correctly.
- Create a cronjob every 15 minutes. This ensures that nearly all tweets are scanned and does not overload the API limit.