Last active
April 18, 2016 18:14
-
-
Save scruffyfox/11a4e73227ce307026c4 to your computer and use it in GitHub Desktop.
Checks every 3 seconds if patch is out
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
#!/usr/bin/env bash | |
while [ 1 ]; do | |
RESP=$(curl -o /dev/null --silent --head --write-out '%{http_code}\n' 'http://www.dota2.com/687') | |
if [ "$RESP" = 200 ]; then | |
echo "***** PATCH OUT HYPE ******" | |
exit | |
else | |
echo "not out" | |
fi | |
sleep 3 | |
done | |
exit |
@benhorst 6.86/10 would hype again
You can add curl -X POST http://textbelt.com/text -d number=[PHONE NUMBER] -d "message=PATCH IS OUT"
between line 5 and 6 to get a nice text message so you don't have to stare at your terminal window 😄
I changed my check to this (in case the title stays the same, I think this is more likely to change):
if [[ $RESP != *"<div id=\"Teaser\"></div>"* ]]; then
And added a slack alert for my friends:
curl -X POST --data-urlencode 'payload={"color":"danger","pretext":"6.86 Alert! Patch page change","text":"@channel check http://dota2.com/686 for update"}' https://hooks.slack.com/services/{{your slack url integration here}}
And added a date to the print so that it is obvious if it hangs:
echo $(date) " not out"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!