Workflow
Grubhub has an API that returns a massive amount of data containing information on each dining location. It is possible to construct a link using the following information:
https://www.grubhub.com/restaurant/NAME/STREET_ADDRESS/ADDRESS_LOCALITY/RESTAURANT_ID
Example: https://www.grubhub.com/restaurant/Au-Bon-Pain-5000-Forbes-Ave.-Pittsburgh/-5954818
In order to use this API, you must use an access token. The access token expires after 30 minutes, so we need to use a separate API call that refreshes the access token. In order to make this API call, we need a refresh token, which we first obtain by capturing HTTP traffic. Unfortunately, the refresh token itself resets every 30 days. Luckily, the refresh token API call also returns a new refresh token that will refresh in another 30 days. The database should store the current refresh token.
Thus, the workflow is as follows (this runs every 15 minutes):
Refresh(refresh_token) → returns new refresh_token and access_token
Get_content(access_token) → returns json with data
Lastly, synthesize the data into links