Skip to content
Social Media Twitter Bot
Python Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
log
FollowerRequests.json
README.md
TwitterBot.py
TwitterConfig.json
cronTask.sh
runTwitterBot.py

README.md

twitter-bot

Social Media Twitter Bot, see me running at HellHippie.com

Getting Started

Fill in the info from your Twitter Development App from https://developer.twitter.com/ in TwitterConfig.json

"Twitter-Keys-And-Tokens": {
	"CONSUMER_KEY"    : "xxxxxxxxxxxxxxxxxxxxxx",
	"CONSUMER_SECRET" : "xxxxxxxxxxxxxxxxxxxxxx",
	"ACCESS_TOKEN"    : "xxxxxxxxxxxxxxxxxxxxxx",
	"ACCESS_SECRET"   : "xxxxxxxxxxxxxxxxxxxxxx"
},

Run The Twitter Bot

There are a few variable definitions to decide in runTwitterBot.py, edit it, then execute it with python3

import TwitterBot

MIN_FOLLOWERS = 16000  # Sanity check on number of followers
MIN_FOLLOWING = 16000  # Sanity check on number following
STAT_DIR='/var/www/hellhippie.com/api/twitter-bot' # Directory to write statistics
LOG_DIR ='log'                                     # Directory to write logs

print('TwitterBot - Running...')
twitterBot = TwitterBot.TwitterBot(logDir=LOG_DIR,statDir=STAT_DIR)
twitterBot.run(minFollowers=MIN_FOLLOWERS,minFollowing=MIN_FOLLOWING)
print('TwitterBot - Complete...')

Twitter IDs to Always Follow

To make sure you never unfollow someone, add them to TwitterConfig.json as IDs. search Google to convert a Twitter Screen name to a Twitter ID

"Twitter-Follow-List": [
	{
		"Description": "The Squad - AOC",
		"Id": 138203134
	},
	{
		"Description": "The Squad - Rashida Tlaib",
		"Id": 435331179
	},
	{
		"Description": "The Squad - Ilhan Omar",
		"Id": 783792992
	},
	{
		"Description": "The Squad - Ayanna Pressley",
		"Id": 31013444
	}
]
You can’t perform that action at this time.