diff --git a/uoftscrapers/scrapers/courses/__init__.py b/uoftscrapers/scrapers/courses/__init__.py index ff04736..617faae 100755 --- a/uoftscrapers/scrapers/courses/__init__.py +++ b/uoftscrapers/scrapers/courses/__init__.py @@ -197,7 +197,7 @@ def parse_course_html(course_id, html): for i in range(len(hours)): x = hours[i].split(':') - hours[i] = int(x[0]) + (int(x[1]) / 60) + hours[i] = (60 * 60 * int(x[0])) + (int(x[1]) * 60) time_data.append(OrderedDict([ ("day", day), diff --git a/uoftscrapers/scrapers/food/__init__.py b/uoftscrapers/scrapers/food/__init__.py index 50ba555..cee3e44 100644 --- a/uoftscrapers/scrapers/food/__init__.py +++ b/uoftscrapers/scrapers/food/__init__.py @@ -78,8 +78,8 @@ def get_hours(food_id): """Parse and return the restaurant's opening and closing times.""" def conv_time(t): - """Convert time of form "HH:MM p.d." to decimal (p.d. is one - of a.m./p.m.)""" + """Convert time of form "HH:MM p.d." to seconds since midnight (p.d. + is one of a.m./p.m.)""" time, period = t[:-4].strip(), t[-4:].strip() @@ -94,7 +94,7 @@ def conv_time(t): h = int(time) h += 12 if period == 'p.m.' else 0 - return h + (m / 60) + return (60 * 60 * h) + (60 * m) headers = { 'Referer': Food.host