A Twitter bot written in Python
- Getting Started
- Prerequisites
- Installation
- Configuration
- Usage
- Logging
- Status Files
- License
- Acknowledgments
These instructions will get you a copy of the project up and running on your local machine.
You'll need to have Python installed in order to run TweetBot. Start by downloading and installing the latest version of Python 3.
Note:
TweetBothas not been tested with Python 2 and will probably not work without changing some things.
Download the latest version from GitHub using Git.
git clone https://github.com/zloether/tweetbot.git
This will create a directory called TweetBot and all the code will be in it.
Switch to the TweetBot directory and install the required packages:
cd TweetBot
pip install -r requirements.txt
You need a Twitter developer account in order to connect to the API. Get started here.
Edit the config/tweet_config.ini file and insert your API credentials for these values:
- oauth_consumer_key
- oauth_consumer_secret
- oauth_token
- oauth_token_secret
The config/tweet_config.ini file also has additional settings you can configure, including whether or not the scripts actually post tweets or not.
The config/things_to_tweet.txt file contains a newline seperated list of things to tweet. Whenever TweetBot runs, it will read this file. When its time to tweet something, it will pick a line at random from this file and tweet that line.
The run_main.bat script will call the tweetbot/tweet_things.py script and store output to the log file.
The run_replies.bat script will call the tweetbot/tweet_replies.py script and store output to the log file.
The run_main.sh script will call the tweetbot/tweet_things.py script and store output to the log file.
The run_replies.sh script will call the tweetbot/tweet_replies.py script and store output to the log file.
A logs directory will be generated inside the project directory.
The tweet_things.py script will write logs to logs/tweet_things.log.
The tweet_replies.py script will write logs to logs/tweet_replies.log.
Several status files will get automatically generated in the project directory when tweetthings.py runs:
anchor.txt- Status ID for the last seen reply messagerequested_friends.txt- ID for users that have already been requested to be friends
This project is licensed under the MIT License - see the LICENSE file for details