-
-
Save danielpunkass/2018752 to your computer and use it in GitHub Desktop.
Self-contained WWDC Status Checker Hack
This file contains 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 | |
# 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" [email protected] < 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