Skip to content

Instantly share code, notes, and snippets.

@Oneiroi
Last active August 9, 2018 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oneiroi/9e4c2ca7fe4ccf93ddaa2867a1bf8cdb to your computer and use it in GitHub Desktop.
Save Oneiroi/9e4c2ca7fe4ccf93ddaa2867a1bf8cdb to your computer and use it in GitHub Desktop.
44con talks page watch
#!/bin/bash
OS=`uname`
URL44CON="https://44con.com/44con/44con-2018/44con-2018-schedule/"
#SET this to rickroll or w/e just make sure your speakers are on full volume
YTALERT="https://www.youtube.com/watch?v=H91rPIq2mN4"
if [ "Darwin" == "${OS}" ]; then
BROWSER="open";
elif [ "Linux" == "${OS}" ]; then
BROWSER="sensible-browser" #Replace this with your browser of choice e.g. firefox
else
echo "OS Detection FAILED :( Aborting"
exit 1
fi
#If you have not already set your ~/.curlrc you will want to set -H "User-Agent: A_BROWSER_UA_STRING" flag to curl.
#sleep command is present to preseve Wheatons law, remove it and you are a dick.
echo "XXX The OS detected is ${OS} I will use ${BROWSER} to open the URLs"; #Uncomment this line to echo out the detected OS & browser
while true; do curl -s ${URL44CON} | grep 'Oops' || (${BROWSER} "${YTALERT}" && \
sleep 1 &&
${BROWSER} "${URL44CON}"); \
sleep 10; done
@Oneiroi
Copy link
Author

Oneiroi commented Aug 9, 2018

updated for 2018, at the time of writing page returns 404 so script greps for 'Oops' and in the absence of this will launch the page and YT alert video

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