Scrape & Map The New Yorker Tables for Two reviews
[View map] (http://htmlpreview.github.io/?https://github.com/tejeffers/T4T-Table-Scraper/blob/master/T4T_google-maps_102816.html)
Here, I’ve used python’s open source beautifulsoup, geopy location services, and Google’s ‘requests’ API to scrape The New Yorker’s Tables for Two restaurant reviews, dating all the way back to 1936! Some have closed, some have moved,
Here’s how it works:
- Scrape each article from TNY’s Tables for Two history
- For each review, save some info in a SQLite database for later:
- Restaurant name
- Address
- Telephone number
- Article Date
- Text of the review
- Grab the latitude and longitude of the restaurant, either using:
- Python geopy
- Google’s ‘requests’ API (so far, neither is perfect…)
- Format [Restaurant Name, Lat, Lng] for loading into Google Maps javascript.
Relevant notebooks:
To Do:
- Sentiment analysis. Although rare, sometimes the reviews aren’t very good. Can I assign a rating system based on the text of the review?
- From text, assign tags — (tacos, noodles, sushi, etc)
- Time series analysis: how has the distribution of restaurants changed over the past 80 years?
- Create a distance-based map: given current location, which amazing restaurant is closest?
- Create a random-restaurant-generator… to resolve weeknight dinner ambivalence.
- Repeat with the BarTabs page! A younger column, but a very valuable resource nevertheless!