Skip to content
Twitter bot written in Python
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.
config
tests
tweetbot
.gitignore
.travis.yml
LICENSE
README.md
requirements.txt
run_main.bat
run_main.sh
run_replies.bat
run_replies.sh

README.md

TweetBot

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.

Prerequisites

You'll need to have Python installed in order to run TweetBot. Start by downloading and installing the latest version of Python 3.

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

Installation

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

Configuration

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.

Usage

Windows

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.

Linux

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.

Logging

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.

Status Files

Several status files will get automatically generated in the project directory when tweetthings.py 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

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

You can’t perform that action at this time.