Backing up my tweets

Twitter logoOver the last month or so, I have gone Twitter crazy. I’ve been transformed from someone who didn’t “get it” into someone who uses Twitter as his main source of news… leaving behind a big pile of unread RSS feeds from blogs (which is exactly why this blog integrates with my Twitter feed). I’d like to further integrate Twitter with this blog (using something like Twitter Tools) but I’m still on an old release of WordPress and still have a way to go on testing the new site (although you can catch a a sneak preview as I inch forward in my development).

In the meantime, I wanted to archive my “tweets” in order to keep a backup as well as to manually transpose the useful ones (not all of the inane babble) into a blog post – sort of like the ones that come from my Delicious feed (although I use Postalicious for that).

I tried various scripts in Python (this one looked hopeful but it uses a deprecated API call), and PowerShell (incidentally, James O’Neill and Joe Pruitt have done some interesting stuff using PowerShell to interface with Twitter) but eventually I realised that a simple curl command could pull all of my Twitter status updates into one or more local XML files. Stage 2 is working out how to apply XSLT (or some other developer magic) to the XML and present it the way I would like, but at least I know I have a local copy of my tweets. The command I used is simple:

curl -O -k -u username:password “https://twitter.com/statuses/user_timeline.xml?count=100&page=[1-32]”

(thanks to Damon Cortesi for posting thismore information on the statuses user_timeline method can be found in the Twitter API documentation.)

I’d like to give one more piece of advice though: the Twitter API restricts the number of calls you can make in an hour to 150. With TweetDeck polling every minute or so, and this command pulling multiple pages of updates through the API, it didn’t take long for me to hit my limit during testing, so you may like to use the maximum page size of 200 tweets (up to 16 times to pull the maximum of 3200 updates that Twitter allows):

curl -O -k -u username:password “https://twitter.com/statuses/user_timeline.xml?count=200&page=[1-16]”

This gives me the data in XML format but I noticed that I can also get hold of it in JSON, RSS or ATOM format – unfortunately I can’t seem to retrieve results based on multiple parameters (e.g. http://twitter.com/statuses/user_timeline.rss?count=200?screen_name=markwilsonit) so Google Reader (or another RSS reader) is limited to the last 20 updates.

Just before I sign off, I’ll mention that, as I was writing this post, I saw that I’ve even begun to open my colleagues’ eyes to the power of Twitter… David Saxon (@dmsaxon) has just joined the party (mind you he pretty much had to after asking our IT Security guys to remove the proxy server restrictions on Twitter use during core working hours today…). Welcome to the fold Dave.

You can follow me on Twitter @markwilsonit.

Coalface Tech: Episode 4 (Windows 7 and Server 2008 R2)

Coalface Tech podcast graphic
Remember the Coalface Tech podcast that James Bannan and I kicked off? Well, after a long break, we finally got another episode out. To be fair, I didn’t have a lot to do with it – the logistics of scheduling podcast recordings between the UK and Australia, battling with VoIP technology, editing audio, losing our hosting provider and fitting it in with work and family life was all a bit too much. Episode 3 was recorded but, by the time we had it ready, it seemed a bit past its sell by date, so James has recorded episode 4 with a new member of the team: Craig Fiegert, who is a Melbourne-based consultant.

The closure of APC Pro magazine caused us some issues and we’ve moved everything across to the coalfacetech.com domain (which is currently working off James’ site). For existing subscribers, we hope to be able to put some redirects on to point to the new feeds but, for the time being, you can either listen to Episode 4 via the web or resubscribe at:

Coalface Tech (MP3 podcast) Coalface Tech (MP3 podcast).
Coalface Tech (AAC podcast) Coalface Tech (AAC podcast with chapter markings and context-sensitive links, etc.).

The iTunes feed (which is the one that gets us recognised) should be back and running as soon as the redirects go in and I’ll also look into submitting the podcast to the Zune Store. Meanwhile, Google Feedburner will tell us if anyone is actually listening!

In short – thank you for bearing with us. Hopefully we’ve got through the worst of the infrastructure issues and James hopes to get new episodes out more regularly now. I’ll still be involved in the background and will make an occasional appearance but, until then, enjoy James and Craig’s discussion of Windows 7 and Windows Server 2008 R2.