A skeleton to create a bot that replies when you mention it, easily customizable 📦
〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
-
Make sure you have Composer
-
Clone the twitter-bot repository into the workbench and install dependencies
git clone https://github.com/phosphore/twitter-bot.git workbench/twitter-bot cd workbench/twitter-bot composer install
-
Register an application and change the consumerKey, consumerSecret, accessToken and accessTokenSecret from 'events/bot.json'
-
Customize the replies
-
Open bot.php and change the path for your json configuration file
-
Set up a cron job to execute bot.php
You may also want to play with the code in bot.php. I tried to comment it as much as possible for your understanding, but you may need to read the Twitter API's doc to have an idea of what kind of objects are returned.
Squarify bot uses this piece of software. You can tweet an image mentioning @squarifybot and it will reply with the modified picture.
〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
👾 Use it responsibly 👾