Last active
December 16, 2015 14:49
-
-
Save bwhiteley/5451948 to your computer and use it in GitHub Desktop.
My WWDC ticket alert system. Run in screen on linux.
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 | |
theSite="https://developer.apple.com/wwdc/" | |
foo=$(curl $theSite) | |
echo $foo | |
oldFile=$(date +"%Y-%m-%d-%H_%M_%S").start | |
echo "$foo" > $oldFile | |
while true; do | |
let slp=$RANDOM%20+10 | |
echo "sleeping $slp $theSite" | |
sleep $slp | |
bar=$(curl --connect-timeout 45 --max-time 60 $theSite) | |
if [ "x$foo" != "x$bar" ]; then | |
mail -r <from_email> -s "WWDC 2013 !" <my_email> <wife_email> <my_phone>@txt.att.net <wife_phone>@tmomail.net << EOS | |
Quick, go to $theSite | |
EOS | |
newFile=$(date +"%Y-%m-%d-%H_%M_%S").txt | |
echo "$bar" > $newFile | |
diff -u $oldFile $newFile | mail -r <from_email> -s "WWDC site diff" <my_email> | |
oldFile=$newFile | |
foo=$bar | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment