Skip to content

Instantly share code, notes, and snippets.

@ethicalaakash
Last active September 10, 2018 07:29
Show Gist options
  • Save ethicalaakash/0632280b5a5b56c97ef590a4e6a29ba2 to your computer and use it in GitHub Desktop.
Save ethicalaakash/0632280b5a5b56c97ef590a4e6a29ba2 to your computer and use it in GitHub Desktop.
Opens browser once tickets are available
#!/usr/bin/env bash
date_of_show=29
theater="PEPSI IMAX, Forum Mall, Koramangala"
movie_name="avengers-infinity-war-3d"
url=https://in.bookmyshow.com/buytickets/$movie_name-bengaluru/movie-bang-ET00074502-MT/201804$date_of_show\#\!seatlayout
if curl $url | grep -q -i "$theater"; then
open $url
osascript -e 'tell app "System Events" to display dialog "Ticket is now available!"'
crontab -l | grep -v 'bookmyshow.sh' | crontab -
fi
@ethicalaakash
Copy link
Author

ethicalaakash commented Apr 23, 2018

Setup a cron job to run this script after every 2mins.
Script will open your default browser once ticket is available and delete the cron job.
NOTE: Works on macOS.

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