Skip to content

Instantly share code, notes, and snippets.

@erickhun
Last active September 30, 2020 12:31
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 erickhun/038c9df8941d4966fef0737394b98df2 to your computer and use it in GitHub Desktop.
Save erickhun/038c9df8941d4966fef0737394b98df2 to your computer and use it in GitHub Desktop.
Check Taipei Universiade Tickets
#!/bin/bash
# Usage : This will check against `page_url` every 180 seconds, put it in a screen or tmux session :
# $ while true; do sh ticket.sh; sleep 180; done
#
page_url='https://tickets.2017.taipei/ticket/area/17_TPE_18/2952'
email='xxx@gmail.com'
#Let's check the length return of the event page
page=`curl -s ${page_url}`
size=${#page}
# The len is longer than 264 chararacters, the tickets is available!
if [ "$size" -gt 264 ]
then
echo "Ticket available! :)"
echo "Buy ticket now! -> ${page_url}" | mail -s "Volleyball Ticket available TPE-JPN FRA-BRA" ${email}
else
echo "Still sold out..."
fi
@erickhun
Copy link
Author

This script was used to get notified by email when some tickets for volleyball games were released during Taipei 2017 Summer Universiade

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