November 28, 2009

Following Twitter from the Command Line

Previously I showed you how to tweet from the command line. It’s even easier to follow your twitter network from the command line.

#!/bin/bash

user=twitteruser
pass=twitterpass

curl -s -u ${user}:${pass} 'http://twitter.com/statuses/friends_timeline.xml?count=30' | xmlstarlet sel -t -m '//status' -v 'user/screen_name' -o ': ' -v 'text' -n

This will show you the last 30 tweets in your friends timelines combined. You can adjust the count to show more or less. Having cUrl and xmlstarlet (a command line XML/XSLT toolkit) installed (and having a bash environment) is a prerequisite.

Leave a comment