Last active
September 10, 2018 07:29
-
-
Save ethicalaakash/0632280b5a5b56c97ef590a4e6a29ba2 to your computer and use it in GitHub Desktop.
Opens browser once tickets are available
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.