Skip to content

Instantly share code, notes, and snippets.

@scruffyfox
Last active April 18, 2016 18:14
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save scruffyfox/11a4e73227ce307026c4 to your computer and use it in GitHub Desktop.
Save scruffyfox/11a4e73227ce307026c4 to your computer and use it in GitHub Desktop.
Checks every 3 seconds if patch is out
#!/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
Copy link

Thank you. Now my terminal is filled with 'not out' and I'm not sure if it's comforting that I'm not missing anything, or a constant reminder of how much the hype needs to leave my body.

@hookdump
Copy link

Thanks!

@FichteFoll
Copy link

@benhorst 6.86/10 would hype again

@spinnercat
Copy link

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 😄

@benhorst
Copy link

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