Tuesday, February 24, 2009

Twitter status from the shell

Here is a quick shell script i whipped up to pull twitter status from the command line. The eventual plan is to pop this in a cron job, pipe it into a file and include this in a php page. Easy status updates for a website headline


#!/bin/sh
USER=$1
wget -qO- \
http://twitter.com/statuses/user_timeline/$USER.xml?count=1 | \
xmlstarlet select -T -t -v '//text'


Call it like...
./twitter-status.sh twitterid


It needs:




The Twitter API...for lulz

No comments: