Skip to content

Instantly share code, notes, and snippets.

@autos
Created December 25, 2015 14:11
Show Gist options
  • Save autos/96a8f03bb7939a72bce7 to your computer and use it in GitHub Desktop.
Save autos/96a8f03bb7939a72bce7 to your computer and use it in GitHub Desktop.
Twitter API rate limits retweets to 15 tweets/ 15 min. So you have to start the program after every 15 mins. Tech people can setup a cron job and forget about it
Functions:
Follow <x> users that tweet with the phrase <Y>.
Favourite <x> tweets that contain the phrase <Y>.
Retweet <x> tweets that contain the phrase <Y>.
http://pastebin.com/aby8VpDu is the source code of the program
http://pastebin.com/k2uyEQR8 is the config file (need to be in the same folder)
http://tempsend.com/3088D29F8D is a packaged exe for Windows
Configuration:
This program requires you to make a twitter bot first. Steps:
1. Go to https://apps.twitter.com (with some fake accounts if you want to go full on) and create an app.
2. Go to the `Keys and Access Token` tab and get the `Consumer Key` and `Consumer Secret`
https://www.anony.ws/i/2015/12/25/first.png
3. Scroll down and generate the access token and note the `Access Token` and `Access Token Secret`.
4. Fill in these details in the config file. `OAUTH_TOKEN`is the Access Token and `OAUTH_SECRECT` is the Access Token Secret. :
https://www.anony.ws/i/2015/12/25/second.png Also enter the twitter handle of the account that is used to create the bot.
Instructions:
-- Linux, Mac -- : Guys do `pip install TwitterFollowBot` and then use the script directly.
-- Windows -- : Just run the exe file.
So if you want to retweet 5 tweets that have the phrase `EvilFacebook` (maybe as a hashtag, maybe not), you will use the `rt` command.
**Caution:** Twitter API rate limits retweets to 15 tweets/ 15 min. So you have to start the program after every 15 mins.
Tech people can setup a cron job and forget about it.
**Note:** You may use this program for any other phrase/hashtag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment