Created
September 12, 2014 07:57
-
-
Save daz/e74d0ee3a6dc4997f0d8 to your computer and use it in GitHub Desktop.
Check URL for changes in a loop
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 | |
URL="http://store.apple.com/au/buy-iphone/iphone6/5.5-inch-display-64gb-space-grey-unlocked?proceed=proceed&step=select&product=MGAH2X%2FA&cppart=UNLOCKED%2FWW&step=select" | |
while true | |
do sleep 20 | |
HASH=$(curl -s "$URL" | shasum) | |
echo -n "." | |
if [ "$HASH" != "$OLD_HASH" ] && [ "$OLD_HASH" != "" ]; then | |
echo "UPDATED - $(date)" | |
open $URL | |
exit | |
fi | |
OLD_HASH=$HASH | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment