Skip to content

Instantly share code, notes, and snippets.

@bwhiteley bwhiteley/wwdc_alert.sh
Last active Dec 16, 2015

Embed
What would you like to do?
My WWDC ticket alert system. Run in screen on linux.
#!/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
You can’t perform that action at this time.