Skip to content

Commit

Permalink
Merge pull request #696 from mileswwatkins/miles/bugfix/oh_quicker_ap…
Browse files Browse the repository at this point in the history
…i_calls

OH: Quicken API calls
  • Loading branch information
rshorey committed Apr 17, 2015
2 parents d68463a + ee4bc9f commit b7eabd4
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions openstates/oh/bills.py
Expand Up @@ -59,7 +59,14 @@ def scrape(self, session, chambers):
"intro_107": ["bill:introduced","bill:passed"],
"imm_consid_360": "bill:passed",
"refer_213":"other",
"adopt_reso_100":"bill:passed"}
"adopt_reso_100":"bill:passed",
"msg_507":"amendment:passed",
"confer_713":"other",
"concur_603":"other",
"confer_712":"other",
"msg_506":"amendment:failed",
"receive_message_100":"bill:passed",
}


base_url = "http://search-prod.lis.state.oh.us"
Expand Down Expand Up @@ -228,7 +235,7 @@ def scrape(self, session, chambers):
self.save_bill(bill)

def pages(self,base_url, first_page):
page = self.get(first_page+"?per_page=300")
page = self.get(first_page)
page = page.json()
yield page
while "nextLink" in page:
Expand Down Expand Up @@ -272,7 +279,9 @@ def add_document(self,documents,bill_id,type_of_document,bill,base_url):
"ICS":"",
"RCS":"",
"EN":"Enacted",
"RCH":"Re-referred"}
"RCH":"Re-referred",
"PHC":""
}

for item in documents:
if type_of_document == "amendment":
Expand All @@ -289,7 +298,10 @@ def add_document(self,documents,bill_id,type_of_document,bill,base_url):
try:
ver = leg_ver_types[item["legacyver"]]
except KeyError:
self.logger.warning("New legacyver type {}, add it to the leg_ver_types dictionary".format(item["legacyver"]))
self.logger.warning(
"New legacyver; check the type and add it to the "
"leg_ver_types dictionary: {} ({})".format(
item["legacyver"], item['link']))
ver = ""
if ver:
name = name+": "+ver
Expand Down

0 comments on commit b7eabd4

Please sign in to comment.