To never forget to tweet for Mandarin class.
- Use pip to install the dependencies in requirements.txt
- Request a Twitter developer account if you don't have one
- Create a Twitter app and obtain your API Keys
- Copy this and add your API keys in a new Python file credentials.py
consumer_key = 'your_key_here' consumer_secret = 'your_key_here' access_token = 'your_key_here' access_token_secret = 'your_key_here'
- Clone this repository to your computer
- Navigate to the project directory
- Run
python bot.py
in the terminal (or run from a development environment) - Keep the bot running even when you close the terminal by using
nohup
- This program takes a set of pre-written tweets from input.txt, separated by a newline
- Enter desired tweets in input.txt
- Go to bot.py and change
time.sleep()
in the for loop to your desired interval. The default is one tweet per 24hrs.
tweet-from-terminal.py is separate from the main program, and it simply allows for tweeting from the command line.
- Follow steps 1-7 in the start guide, adjustments are not relevant (substitute bot.py for tweet-from-terminal.py in each step
- Important: Currently only works from console, does not work in terminal
- Allow updates to input.txt while program is running
- Support image tweeting
- If user has already tweeted today, don't have the bot tweet
- Use AI to get data from user tweets (or use a dataset) to generate original tweets that mimic the user
Tweepy handles OAuth and Tweeting functionality.
Here are the Tweepy Docs