Skip to content
Andy Braren edited this page Jan 31, 2015 · 6 revisions

General Approach

Our JS/JQuery-based scraper will look at Tufts' official dining pages to determine what's being served in the dining hall each day.

To start, we can parse just the current day's meals in both Dewick and Carmichael and display those to the user. Then we can add the remaining locations, and save day-by-day navigation for last.

URLS we'll use

There's a desktop and a mobile version of each page. We should use the mobile version because it's slightly lighter.

Clicking a menu item brings you to a page with that item's nutritional information. By default the URLs look like this:

http://menus.tufts.edu/foodpro/label.asp?locationNum=11&locationName=Dewick-MacPhie+Dining+Center&dtdate=1%2F31%2F2015&RecNumAndPort=031002%2A4

But this URL can be simplified to just: http://menus.tufts.edu/foodpro/label.asp?RecNumAndPort=031002

This URL can be used for 'No Cholesterol Egg White' across both Carmichael and Dewick. We could create an immense array with the entire menu of things served in the Dining Halls, but that may be too tedious and difficult to maintain. Instead, loading only the main menu page for the given day, displaying every item within Dash, and using jQuery to dynamically "click" an item and gather its nutritional info when a user wants to know more probably makes the most sense.

Notifications

Because this is a webapp, push notifications probably won't be possible. Instead, we can notify users when their favorite food will be served within the next 2-3 days using something like this:

  • Store the user's favorite foods in a cookie
  • On load, check if their favorite food is listed in the HTML of any menu within the next 1-2 days
  • If it is, tell the user within the main Food bubble that their favorite food will be served "Tomorrow in Dewick for lunch"
Clone this wiki locally