Simon Willison’s Weblog

Subscribe

Abusing the command line

26th March 2004

If you’re running OS X, try this:

say -v Kathy `curl --silent http://api.technorati.com/getinfo?username=simonwillison | grep ’<inbound' | sed -e 's/ <//' | sed -e 's/inboundblogs>/Simons blog has /’ | sed -e ’s/<\/inboundblogs>/ inbound blogs and /’ | sed -e ’s/inboundlinks>//’ | sed -e ’s/<\/inboundlinks>/ inbound links/’`

Your computer should read out to you my Technorati inbound blogs and inbound links, extracted from the Technorati web API. Parsing XML using sed is a nasty trick I picked up from this O’Reilly article; speaking the output of a command using the ’say’ and the backtick shell operator was my moment of inspiration for the day.

This is Abusing the command line by Simon Willison, posted on 26th March 2004.

Next: Conferences with Macs

Previous: Quicksilver

Previously hosted at http://simon.incutio.com/archive/2004/03/26/abusing