Skip to content

Commit

Permalink
Merge pull request #58 from g3wanghc/master
Browse files Browse the repository at this point in the history
Events: use campus tag instead of full name
  • Loading branch information
qasim committed Apr 19, 2016
2 parents 93cc11c + 93d092e commit edf16c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion uoftscrapers/scrapers/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class Events:
"""A scraper for Events at the University of Toronto."""
host = 'https://www.events.utoronto.ca/'

campuses_tags = {'St. George': 'UTSG', 'U of T Mississauga': 'UTM', 'U of T Scarborough': 'UTSC'}

@staticmethod
def scrape(location='.'):
Scraper.logger.info('Events initialized.')
Expand Down Expand Up @@ -74,7 +76,8 @@ def get_event_doc(url_tail):

event_campus = ''
if evt_bar.select('dd')[0].b != None:
event_campus = evt_bar.select('dd')[0].b.text
campus_full_name = evt_bar.select('dd')[0].b.text
event_campus = Events.campuses_tags[campus_full_name]

event_address = ''
address_block = evt_bar.select('dd')[0]
Expand Down

0 comments on commit edf16c7

Please sign in to comment.