Skip to content

Instantly share code, notes, and snippets.

@janhenrik
Created September 27, 2012 12:25
Show Gist options
  • Save janhenrik/3793723 to your computer and use it in GitHub Desktop.
Save janhenrik/3793723 to your computer and use it in GitHub Desktop.
#!/bin/bash
HASH="6d1c3b49ec99b098212d357e0d8e6add"
URL="http://store.apple.com/no/browse/home/shop_iphone/family/iphone"
NEW_HASH=`curl -s $URL | md5 -q`
if [[ "${HASH}" == "${NEW_HASH}" ]]; then
echo "NOTICE: hasn't changed"
else
echo "ALERT: [$URL] CHANGED from [$HASH] to [$NEW_HASH]"
mail -s "ALERT: [$URL] CHANGED from [$HASH] to [$HASHVALUE] - buy the iPhone 5!!!" my@email.com </dev/null
fi
@janhenrik
Copy link
Author

Hashen fungerte dårlig, prøv denne

#!/bin/bash
URL="http://store.apple.com/no/browse/home/shop_iphone/family/iphone"
KOMMER=`curl -s $URL | grep -i "kommer snart"`
if [[ -z "${KOMMER}" ]]; then
    echo "ALERT: [$URL] iPhone5 har kanskje kommet!!!!"
    mail -s "ALERT: [$URL] iPhone5 har kanskje kommet!!!!" janhenrik@gundelsby.com </dev/null
else
        echo "NOTICE: iPhone5 kommer snart..."
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment