Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Python workers that collect tweets from the twitter streaming api and track deletions
Python JavaScript
branch: master

Move failure-prone url request inside try block; don't retry request

Retrying the web request for logging purposes was causing an uncaught
latest commit f369e55157
@handlers handlers authored

Install Beanstalkd

Requires installing the libevent-dev package on apt-based systems.

Install Python dependencies

Install pip if you don't already have it then run:

pip install -r requirements.txt

Edit config file


cp conf/tweets-client.ini.example conf/tweets-client.ini

In the [tweets-client] section, add your Twitter account's username and password. This account will be authenticated against to make all API requests.

In the [beanstalk] section, change "tweets_tube" and "screenshot_tube". The values don't matter much, they just need to be unique.

In the [database] section, update the "host", "port", "username", "password", and "database" sections with your own details, if the defaults are not appropriate.

In the [aws] section, add your access key, secret access key, bucket name, and any path prefix inside the bucket you want to use. This is for archiving images and screenshots of tweeted links.


Run to start streaming items from Twitter into the beanstalk queue. Append the lib directory to the PYTHONPATH, either persistently or as part of the command:


Then run to start pulling the tweets out of beanstalk and loading them into MySQL:

PYTHONPATH=$PYTHONPATH:`pwd`/lib ./bin/ --images

Finally, if you ran with the images option turned on, run to grab screenshots of webpages and mirror images linked in tweets.


These three scripts all accept the following options:

  • --loglevel - Sets the verbosity of logging.
  • --output - Destination for log files.
  • --restart - Restart if the script encounters an error that cannot be handled.
Something went wrong with that request. Please try again.