Update a local archive of your tweets.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 1 commit behind drdrang:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Tweet archiver

This Python script and the related files will download your tweets from Twitter and save them in a plaintext archive file on your computer. It is intended to be run periodically to add recent tweets to an existing archive file. The script (in a slightly earlier version) is described in this blog post. If you already have an archive of tweets in ThinkUp, you might find this post useful in turning it into a plaintext archive. If you are starting an archive from scratch, this post and script by Tim Bueno will be helpful.

The files in the repository are:

  • archive-tweets.py. This is the script that does the archiving. It can be stored anywhere and should be run periodically via a system like cron or launchd.
  • twitter.txt. This is the archive file itself, currently empty. It should be kept in a folder named twitter inside your Dropbox folder.
  • twitter-credentials. This file should be renamed .twitter-credentials and saved in your home directory. The values for consumerKey, consumerSecret, token, and tokenSecret must be provided by Twitter. Go to the Twitter developer site, click the "Create an app" link, and follow the instructions given there for creating an app. When you're done, you'll be given the four credentials—long strings of letters and numbers—you'll need.
  • lastID.txt. This file holds the ID number of the most recently archived tweet; it currently holds a dummy value you'll need to change. It should be kept in the same folder as twitter.txt.

You don't have to keep your archive in Dropbox, but that's a convenient place to be able to access your tweets from any of your computers. The directory for the archive can be changed by editing Line 10 of archive-tweets.py.