Microsoft (MS) Flow: Check and be notified when movie tickets go on sale

While attempting to obtain awesome opening day seats for Star Wars Solo, I discovered another way to use Microsoft Flow that I wanted to share. In brief, MS Flow can be used to poll a web site and look for certain content in the response (Body). If you are one to repeatedly check a website throughout the day in anticipation of something happening (tickets going on sale, results posted, etc.), this Flow may benefit you as well.

Being notified when tickets for a certain movie go on sale is not a new concept - Fandango and other ticket sellers allow you to sign up to receive email alerts (similarly to what this Flow accomplishes). In my experience, there is often a delay (sometimes days) in receiving the “built in” email notifications; hence, I decided to put Flow to work.

Overview

Read on for more detailed information about the trigger and actions

  • Use the “Recurrence” trigger to specify how often you want Flow to check for movies tickets
  • Use the “HTTP” action to poll a URL where tickets will be available when they go on sale (example: IMAX)
  • Use a condition to look for the presence (or lack of) certain text on the website (in the Body of the HTTP response)
  • Use the “Send an Email” action to send a notification to your email or phone (SMS/text using your carrier’s email to SMS gateway address)

The completed flow

Overview of entire flow

Recurrence

The Recurrence trigger is almost synonymous to Cron on Linux. It allows you to kick off a Flow at specific intervals. In my case, checking once per hour was sufficient; depending on your requirement, you can adjust the interval. Note, if you are on the free Flow plan, you are limited to one run per 15 minutes.

MS Flow Trigger: Recurrence

HTTP

I suspect this action is designed to allow Flow to consume web services. As it happens, it can also be used for something much easier: accessing a URL and obtaining the HTML of the resulting page (like wget or curl). The hardest part of this step is finding a website that sells movie tickets that returns content properly when accessed in this manner. The action provides many options for customization (HTTP method, headers, etc.) but despite this, I was unable to get a valid response from Fandango (suspect Javascript/AJAX dependencies that render the final list of showtimes).

Instead of spending time trying to fix that, I simply located another site with a “landing page” for Star Wars Solo (that would ultimately contain a list of showtimes when tickets officially went on sale). IMAX to the rescue! From what I determined, IMAX often creates “place holder” pages for popular movies before tickets go on sale - they reside under /movies/name-of-movie.

It is also worth noting that if IMAX cannot determine the location of the client making the HTTP request, it defaults to Los Angeles, California and returns results for that region. In this case, that was fine - movie tickets generally go on sale to the public in all US locations simultaneously.

MS Flow Action: Get event (V2)

Condition

IMAX made creating this condition very easy (thanks IMAX). To get a sense of the HTML that is returned from the HTTP action above, I recommend polling (and viewing in the browser) a few examples of IMAX showtime listings (the HTML Body anyway). At minimum, 1 for a movie where tickets ARE on sale and 1 for a movie where tickets ARE NOT on sale.

After a cursory review, it seemed most logical for me to check that the Body (returned from the HTTP action) did not contain the text “No upcoming showtimes”. If IMAX does not yet have movie times, that text is rendered as part of the Body (response); that specific text is never returned if show times are available.

MS Flow Action: Get event (V2)

Send an Email

This is a run of the mill action that sends notifications to your email addresses and/or mobile phone via SMS if the condition above is true. In my case, simply knowing tickets were on sale was good enough - I did not aim to automate the purchase of tickets.

You could also use a “Notifications” action (push, etc.) here.

Final comments

This ended up working very smoothly - more so than I would have guessed with such minimal testing and effort up front. Like clockwork, Microsoft Flow emailed me at around 10:00 PM Mountain time on May the 4th and I was the second person to secure tickets at one of Albuquerque’s leading theaters for the earliest showing of Solo on May 24.

Note, there was a lot of speculation that Solo tickets would go on sale on May 4th, so this was not a huge surprise. I plan to reuse this approach in the future when the date tickets go on sale is less predictable.

Lastly, remember to turn off the Flow once tickets go on sale - otherwise, you will be notified every hour until the end of time. Alternatively, build logic into your Flow so it only notifies you once!