Like many have previously mentioned, GeekTool is a pretty handy little thing (see here, here and here for some good examples). But I was interested in using it with Lynx, a text-based command line web browser -- most easily available from the guys at Fink. Lynx is a great app if your boss can be convinced you're hard at work when he sees a black and white screen full of letters and numbers. But Lynx is by default interactive -- not much use when you can only look at output through GeekTool, so I created the following Script job in Geek tool:
/sw/bin/lynx -dump -width=160 -nolist http://news.bbc.co.uk/text_only.stm
Set this job to run every five minutes or so, and now I've got up-to-the-minute news headlines available just an Exposé command away.
However, the dump file is still kinda large, and I'm not so urgently interested in what's happening in Wales as I am in what's happening on my own doorstep, so I created the following script:
#!/bin/bash
TMPFILE=/tmp/bbcheadlines.tmp
WEBSITE=http://news.bbc.co.uk/text_only.stm
CUTOFF="^[^w]*____"
/sw/bin/lynx -dump $WEBSITE >$TMPFILE
for param in $@
do
cat $TMPFILE | sed -n '/^ *'$param'/,/'$CUTOFF'/p' | sed '$d'
echo
done
This script grabs the $WEBSITE and writes it to a file (chosen by $TMPFILE). It then loops through my parameters, using sed to check for sections that begin with the parameter and end with $CUTOFF, writing the results to sysout. Saving this script as headlines.sh to my home directory, I needed only to put the following job into GeekTool:
/Users/myhomedir/headlines.sh SPORT EUROPE POLITICS
And voila! Customised news headlines on my desktop every five minutes. The script will obviously need some customising for your own favourite websites (anyone want to come up with a good one for MacOSXHints?), but I thought I'd just put the idea out there.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040821171457323