tag archive: twitter

Python script for backing up Twitter statuses

I was looking for a way to backup my tweets (I find that I’m reluctantly giving over to calling Twitter posts by that name, but I don’t feel good about it) and found this “recipe” at ActiveState’s web site:

Recipe 576594: Backup/download your tweets or anyone’s tweets.

It’s a nice simple Python script that saves messages to a text file. Works great, although I wanted some more. It doesn’t save timestamps and also leaves HTML link tags in there. The recipe also introduced me to a nifty library, “Beautiful Soup“, which is a “Python HTML/XML parser designed for quick turnaround projects like screen-scraping.”

Since I’ve been intending to get back into learning and using Python, this was a good opportunity to play around a bit. Starting from Zach’s code and with the nice Beautiful Soup documentation, it didn’t take long to figure out how to extract more from the Twitter pages. Also there was some fun with regular …

trying out twitter

I’m at http://twitter.com/scarpent. You must follow my twitterings with rapt devotion. (Note that this post is exactly 140 characters long.)