@@ -0,0 +1,1694 @@
+import requests%0Afrom bs4 import BeautifulSoup%0Afrom collections import OrderedDict%0Aimport json%0Afrom ..scraper import Scraper%0A%0A%0Aclass Food(Scraper):%0A    %22%22%22A scraper for UofT restaurants.%0A%0A    UofT Food data is located at http://map.utoronto.ca%0A    %22%22%22%0A%0A    def __init__(self, output_location='.'):%0A        super().__init__('Food', output_location)%0A%0A        self.host = 'http://map.utoronto.ca/'%0A        self.campuses = %5B'utsg', 'utm', 'utsc'%5D%0A        self.s = requests.Session()%0A%0A    def get_hours(self, food_id):%0A        %22%22%22Parse and return the restaurant's opening and closing times.%22%22%22%0A        headers = %7B%0A            'Referer': self.host%0A        %7D%0A        html = self.s.get('%25s%25s%25s' %25 (self.host, 'json/hours/', food_id),%0A                          headers=headers).text%0A%0A        soup = BeautifulSoup(html, 'html.parser')%0A%0A        if not soup.find('tbody').text == '':%0A            hours = OrderedDict()%0A%0A            days = %5B'sunday', 'monday', 'tuesday', 'wednesday', 'thursday',%0A                    'friday', 'saturday'%5D%0A%0A            timings = soup.find('tbody').find_all('td')%0A%0A            for i in range(len(timings)):%0A                closed, opening, closing = False, '', ''%0A                day, timing = days%5Bi%5D, timings%5Bi%5D.text%0A%0A                # when closed for the full day, timing will not have a '-'%0A                if '-' in timing:%0A                    opening, closing = timing.split(' -')%0A                else:%0A                    closed = True%0A%0A                hours.update(%7Bday: OrderedDict(%5B%0A                    ('closed', closed),%0A                    ('open', opening),%0A                    ('close', closing)%5D)%7D)%0A%0A            return hours%0A        else:%0A            return ''%0A

Initialize Food scraper, add timing scraper