Open Table Mapping
What is Open Table?
Open Table is the world's leading provider of online restaurant reservations. On Open Table, one may check the availability of a seat based on the date, the time, and the number of people in a party.
Food is the ultimate glue to many relationships whether they be professional, friendly, or romantic. As human beings are social animals, it is crucial to have a moment to sit and communicate for extended periods of time at the same time, fill a survival need of hunger. Time is of utmost importance and waiting to be seated is an enormous waste. This project is designed to not only reduce such waste but also find information on possible candidates to dine on.
Scraping information from OpenTable was not a fluid process. A Scrapy Spider was not an option because of a unique block implemented on the website. To get around this block was to use a browser based scraping such as Selenium. Each page had to be loaded via Selenium and data was collected by first receiving the names of each available restaurant in the given time frame and then going through each restaurant page to obtain information.
The links were designed in that it had to fit one of three models:
Regular Expressions were used to customize each of the restaurant links to fit the model above. Several examples in this link customization were: the spaces in each restaurant name were replaced with a hyphen in the link, symbols such as "&" had to be replaced with the characters "and," and each special character except the hyphen had to be removed.
The final problem was reading the data collected in python. Unicode scripts supported the accented letters such as "é," however, Python was unable to read this and had to be arranged by normalizing the Unicode data. (Sample Code on Bottom)
A visual map was created using Carto. On the right, a widget was added to filter based on the type of dining style or environment of the restaurant and the type of cuisine the restaurant serves.
Each of the red dots represents the location of the restaurants that are available for reservation. If the red dots are clicked, the information about that restaurant is given as shown above.
Unsurprisingly, my project does not have all the implementation of the current OpenTable map function. Their map service is able to show the available restaurants in real time. It is also able to quickly change the time frame, date and the number of people in a party instantly.
My current model is currently only able to take fixed input values for the date, time and party size. While it is able to filter on different factors more quickly, there are only a few significant advantages over what Open Table currently has. However, that is soon to change.
Several ideas can be implemented to improve upon the current model. One feature is to scrape movie theater, Broadway shows, concerts, and shopping mall data to add as layers to the current map. This would have the effect of allowing to recommend an entire date night. Another idea that must be added is to attach a user input for the desired date, time and party size to obtain a map of real-time data. At the very least, the goal is to improve upon the current Open Table map for a more enjoyable or even better user experience.
Here is a link to my map: The Project
Here is my code: (Geographical Coordinates added using ggmap on R)