Skip to content

Instantly share code, notes, and snippets.

@calmez
Created November 11, 2012 20:11
Show Gist options
  • Save calmez/4056095 to your computer and use it in GitHub Desktop.
Save calmez/4056095 to your computer and use it in GitHub Desktop.
small script that tells you when mountain lion is available
#!/bin/sh
URL='http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMultiRoom?fcId=489264329&mt=12'
SEARCH_STRING="mountain"
echo "Mountain Lion"
echo "Press Ctrl-C to exit."
echo ""
while true ; do
curl -silent -A "iMacAppStore/1.0.1 (Macintosh; U; Intel Mac OS X 10.6.7; en) AppleWebKit/533.20.25" ${URL} | grep -i "${SEARCH_STRING}" > /dev/null
if [ "$?" == "0" ]; then
echo "Search string found!"
say "Mountain Lion has been released"
echo "Opening search URL"
open $URL
exit
else
echo "Nothing found yet. Trying again in 5 minutes..."
fi
sleep 300
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment