Skip to content

Instantly share code, notes, and snippets.

@benburton
Created April 18, 2013 21:44
Show Gist options
  • Save benburton/5416481 to your computer and use it in GitHub Desktop.
Save benburton/5416481 to your computer and use it in GitHub Desktop.
Poll whytheluckystiff.net for new pages, download them, and provide notifier alerts.
#!/bin/sh
RECENT=`curl -s http://whytheluckystiff.net | awk '/./{line=$0} END{print line}' | awk '{print $1}'`
while [ true ]
do
LATEST=`curl -s http://whytheluckystiff.net | awk '/./{line=$0} END{print line}' | awk '{print $1}'`
if [ "$RECENT" != "$LATEST" ]
then
wget http://whytheluckystiff.net/${LATEST}
terminal-notifier -message $LATEST -title '_why'
RECENT=$LATEST
fi
sleep 3
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment