Read xkcd titles from the command line
Does your mobile browser have difficulty reading the ‘title’ attribute on xkcd strips? Is this a problem for you? Does your mobile device have command-line access to a unix-like system? If so, you may find the following title-extracting script useful. Call without arguments for the latest strip, or supply the strip number as an argument:
#!/bin/bash
if [ $1 ]; then
URLPATH=$1/
fi
curl -s http://www.xkcd.com/$URLPATH |grep "img.*title" \
|sed 's/.* title="\([^"]*\).*/\1/'
May 12th, 2009 at 10:05 am
That is a nifty regular expression, dude.