Skip to content
Twitter bot written in Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Python Build Status Issues License

A Twitter bot written in Python

Table of Contents

Getting Started

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 Start by downloading and installing the latest version of Python 3.

Note: has not been tested with Python 2 and will probably not work without changing some things.

After Python is installed, install the requests and requests_oauthlib libraries.

pip install requests requests_oauthlib


Download the latest version from GitHub using Git.

git clone

This will create a directory called and all the code will be in it.


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/things_to_tweet.txt file contains a newline seperated list of things to tweet. Whenever 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.

Three scripts use boolean values to control if they write to the API. Toggle them between True and False to enable or disable, respectively, writing to the API.




The run_main.bat script will call the script and store output to the log file.

The run_replies.bat script will call the script and store output to the log file.


The script will call the script and store output to the log file.

The script will call the script and store output to the log file.


A logs directory will be generated inside the project directory.

The script will write logs to logs/tweet_things.log.

The script will write logs to logs/tweet_replies.log.

Status Files

Several status files will get automatically generated in the project directory when runs:

  • anchor.txt- Status ID for the last seen reply message
  • requested_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


You can’t perform that action at this time.