A browsable, searchable archive of tweets

In the past, I’ve wanted to browse or search through my own tweets. Viewing my Twitter profile is one way to do that. But if I want to browse back through history, it’s a chore to go back very far. And forget about searching through my own tweets on Twitter since Twitter Search currently only goes back about a seven days.

I know there are a few apps or scripts that create backups and much more for you. But I wanted a database and simple UI completely within my own control. One that wouldn’t go away if the developer abandoned it. So one Saturday a few weeks ago, in a little over an hour, I had my own, free, browsable, searchable tweet archive. Now I can easily browse back to my very first tweet, or search for those quotes by Paul Rand I tweeted last year. This isn’t anything entirely new. I’m just writing it up what works for me in case it helps fit some pieces together.

How to set up your own tweet archive with WordPress

  1. Assuming you have a collection of past tweets, the first step is to collect them in one place. TweetBackup.com provides an easy way to do this. It uses OAuth, so there’s no need to enter your username or password as long as you’re already signed into twitter.com. Give them an email address, and your tweets start backing up immediately. (See their FAQ about a possible limitation of 3200 tweets.)
  2. Once TweetBackup is done grabbing all your tweets (it took about 2 minutes for my ~1,400 tweets), go to the Export tab, and save the RSS format to your local drive
  3. Install a fresh copy of WordPress somewhere on your server if you don’t want tweets intermingled with other WP content. In the Tools section of WordPress, use the built-in RSS importer to import the file you saved from TweetBackup.
  4. Assuming you want WordPress to automatically grab each tweet from this point forward, install the Twitter Tools plugin, enter your Twitter credentials in its settings screen, and configure it to create a blog post for each of your tweets. (Turn off the option to tweet when a post is created from this blog so the universe doesn’t explode in some endless loop of repeating tweets and blog posts.)
  5. Update: I made the WP theme files for my tweet archive available for download for anyone who’d like to use them wholesale or as a base for their own archive.
  6. That’s it.

A few extra steps, if you’re up for them

  1. Twitter Tools will handle future tweets correctly. But the format of each tweet from TweetBackup starts with a prefix of your Twitter username, followed by a space and a colon, like this: “stop: Clicking through the new design of…”. I used the Search Regex plugin to search for and eliminate that prefix.
  2. Past tweets from TweetBackup won’t have linked URLs. The Autolink URI plugin can do this for you automatically.
  3. If you’re good enough with regular expressions, you can also use the Search Regex plugin to link up any @mentions and #hashtags in your tweets. I suck at regex, so I cheated and used some of the patterns from David Walsh within the Search Regex search/replace UI. Technically, you could probably use David’s first pattern to link up URLs too.
  4. A few WP plugins can enhance the built-in search functionality of WordPress. I’m using Search Everything.
  5. WP Super Cache will keep server resources to a minimum and help load pages quickly once they’re cached.
  6. If you’re really up for it, you can customize the templates and design as I did. Anything is possible if you’re familiar with PHP and WordPress templates. For instance, you could try using the Similar Posts plugin to suggest possibly related tweets on the permalink page.

Now, every tweet you’ve written and will write can be duplicated and backed up in your own MYSQL database, accessible via a WordPress front end. Technically, you could probably use any blogging platform or CMS to do this. (It doesn’t require WordPress.) You’ll just need a means to import old tweets and automatically grab new tweets.

About the author

Designer, advisor, father. Previously led design teams at Twitter, Google, and Wired. Giants fan. Deutsche lernen. Wanna-be runner.

Recently by Doug