Skip to content

Instantly share code, notes, and snippets.

@itsprdp
Last active August 15, 2018 08:57
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 itsprdp/8ca5a37084732c76f383b67f7ebcf3ca to your computer and use it in GitHub Desktop.
Save itsprdp/8ca5a37084732c76f383b67f7ebcf3ca to your computer and use it in GitHub Desktop.
OSX BookMyShow Notifier

BookMyShow Notifer

This script notifies the user if the particular show is open for bookings for a specific set of Multiplexes.

MovieCode is extracted from the URL
Ex: https://in.bookmyshow.com/buytickets/geetha-govindam-hyderabad/movie-hyd-ET00078428-MT/20180815
Usage: ./bmsShowNotifier geetha-govindam-hyderabad/movie-hyd-ET00078428-MT INOX 20180815

Setup cron to run every minute:

$ crontab -e
* * * * * /Users/$(whoami)/bmsShowNotifier.sh geetha-govindam-hyderabad/movie-hyd-ET00078428-MT PVR 20180818
#!/bin/bash
# MovieCode is extracted from the URL
# Ex: https://in.bookmyshow.com/buytickets/geetha-govindam-hyderabad/movie-hyd-ET00078428-MT/20180815
# Usage: ./bmsShowNotifier -c geetha-govindam-hyderabad/movie-hyd-ET00078428-MT -d 20180815
bms_url="https://in.bookmyshow.com/buytickets"
movie_code=$1
show_date=$3
multiplex=$2
count=`curl -s ${bms_url}/${movie_code}/${show_date} | grep "data-name=\"$multiplex" | wc -l`
if [ $count -gt 0 ]; then
title="BookMyShow Alerts"
message="PVR Screens are open for showtimings on $show_date"
osascript -e "display notification \"$message\" with title \"$title\" subtitle \"Movie: $movie_code\""
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment