Skip to content

Instantly share code, notes, and snippets.

@grapeot
Created May 3, 2013 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grapeot/5507168 to your computer and use it in GitHub Desktop.
Save grapeot/5507168 to your computer and use it in GitHub Desktop.
Mount it on crontab, and it will send you daily xkcd pick.
num=$(curl -s xkcd.com | grep -oh -m 1 'v" href="/[0-9]*' | sed 's/v" href="\/'//)
n=$[ $RANDOM % $num ]
curl -s xkcd.com/$n/ | grep '<img.*comics' | mail -a 'Content-Type: text/html' -s 'xkcd daily pick' <email>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment