Created
March 11, 2012 18:50
-
-
Save rcw3/2017653 to your computer and use it in GitHub Desktop.
Crude WWDC announcement detector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
testSiteForChanges () | |
{ | |
ls "old_page.html" 1>/dev/null 2>/dev/null | |
if [ $? -eq "1" ] ; then | |
wget -q -O old_page.html $1 | |
fi | |
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 | |
} | |
#testSiteForChanges "http://www.cnn.com" | |
testSiteForChanges "https://developer.apple.com/wwdc/" | |
if [ $? -eq "1" ] ; then | |
echo "WWDC MAY HAVE BEEN ANNOUNCED!!" > wwdc_email.txt | |
mail -s "WWDC" you@some_address.com < wwdc_email.txt | |
rm wwdc_email.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment