Skip to content

Instantly share code, notes, and snippets.

@dhinus
Last active September 1, 2015 23:17
Show Gist options
  • Save dhinus/ef9947d7cdbe93ff5f78 to your computer and use it in GitHub Desktop.
Save dhinus/ef9947d7cdbe93ff5f78 to your computer and use it in GitHub Desktop.
Ticket notifier
#!/bin/bash
URL='http://tickets.southbankcentre.co.uk/production/bookingwidget/91964'
REGEX='<form'
INTERVAL=60
while true; do
TKTS=$(curl -s $URL)
if [[ $TKTS =~ $REGEX ]]; then
RES='TKTS!!!!1!!1! '$(date)
terminal-notifier -message "$RES"
else
RES='no tkts '$(date)
fi
echo $RES
sleep $INTERVAL
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment