Monday 25 May 2009

Happy Towel Day

Happy Towel Day

The Hitch Hiker's Guide to the Galaxy has a few things to say on the subject of towels...

"A towel, it says, is about the most massively useful thing an interstellar hitchhiker can have. Partly it has great practical value - you can wrap it around you for warmth as you bound across the cold moons of Jaglan Beta; you can lie on it on the brilliant marble-sanded beaches of Santraginus V, inhaling the heady sea vapours; more ... (see also the bbc )

Thursday 21 May 2009

twithash

twithash - a shell script to search tweets (uses wget and awk)

#=cut here=======================================================
#!/bin/bash
if [ "$1" == "" ] ; then echo "Usage: twithash searchterm (nb. # added automatically)"
else wget -q -O - http://search.twitter.com/search.atom?q=%23$1|awk '/title/ { gsub("[<</]*title>","") ;text=$0} /<name>/{ gsub ("[<</]*name>",""); split($0,N);print N[1]":"substr(text,4)}'
fi
#================================================================


use with "watch" command to monitor a twitter hashtag in a shell
eg. watch -n 60 twithash qanda

example output:

armagny: #qanda Penny Wong continues to impress with self control and absence of sneer or carp.
armagny: #qanda Unethical spin spend is where you take money given for policy advisers & give to journos, or other flakes
jackwork:khas
BLOWFLYwine: Clean coal is vaporware... but if Penny doesn't sell it, the government would be concerned about losing future tax revenue #qanda
...

Monday 18 May 2009