Skip to content

Commit

Permalink
Patch json getters for Buildings
Browse files Browse the repository at this point in the history
  • Loading branch information
kashav committed Apr 20, 2016
1 parent f96989d commit 095f577
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions uoftscrapers/scrapers/buildings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from bs4 import BeautifulSoup
from collections import OrderedDict
from decimal import *
import json
import os
import re

Expand Down Expand Up @@ -83,13 +82,12 @@ def get_map_json(campus):
Scraper.get(Buildings.host)

headers = {'Referer': Buildings.host}
html = Scraper.get('%s%s%s' % (
data = Scraper.get('%s%s%s' % (
Buildings.host,
'data/map/',
campus
), headers=headers)
), headers=headers, json=True)

data = json.loads(html)
return data

@staticmethod
Expand All @@ -99,11 +97,10 @@ def get_regions_json(campus):
Scraper.get(Buildings.host)

headers = {'Referer': Buildings.host}
html = Scraper.get('%s%s%s' % (
data = Scraper.get('%s%s%s' % (
Buildings.host,
'data/regions/',
campus
), headers=headers)
), headers=headers, json=True)

data = json.loads(html)
return data

0 comments on commit 095f577

Please sign in to comment.