Skip to content

Instantly share code, notes, and snippets.

@rcw3
Created March 11, 2012 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save rcw3/2018059 to your computer and use it in GitHub Desktop.
Save rcw3/2018059 to your computer and use it in GitHub Desktop.
Self-contained WWDC Status Checker Hack
#!/bin/bash
# run from terminal and you can watch it log as well... or nohup it
cd ~
testSiteForChanges ()
{
ls "old_page.html" 1>/dev/null 2>/dev/null
if [ $? -eq "1" ] ; then
/usr/local/bin/wget -q -O old_page.html $1
fi
/usr/local/bin/wget -q -O new_page.html $1
diff old_page.html new_page.html 1>/dev/null
if [ $? -eq "0" ] ; then
#echo "SAME!"
CHANGES=0
else
#echo "CURRENT WEB PAGE IS DIFFERENT THAN ORIGINAL!!"
CHANGES=1
fi
rm new_page.html
return $CHANGES
}
while true
do
{
#testSiteForChanges "http://www.cnn.com"
testSiteForChanges "https://developer.apple.com/wwdc/"
if [ $? -eq "1" ] ; then
echo "WWDC MAY HAVE BEEN ANNOUNCED!!" > wwdc_email.txt
/usr/bin/mail -s "WWDC" YOUR_EMAIL_GOES_HERE@blackpixel.com < wwdc_email.txt
rm wwdc_email.txt
echo "$(date) WWDC MAY HAVE BEEN ANNOUNCED!!"
echo "$(date) WWDC MAY HAVE BEEN ANNOUNCED!!" >> wwdc.log
else
echo "$(date) WWDC Checked... no changes"
echo "$(date) WWDC Checked... no changes" >> wwdc.log
fi
sleep 300
}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment