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.
Purpose
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.
Problems Encountered
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:
www.opentable.com/"RestaurantName"
www.opentable.com/r/"RestaurantName"
www.opentable.com/r/"RestaurantName-New-York"
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)
The Map
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.
Advantages?
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.
Future Improvement
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)