Skip to content

Commit

Permalink
Merge pull request #5087 from openstates/usa-more-doc-note-trim
Browse files Browse the repository at this point in the history
USA: Trim more bill document note property strings
  • Loading branch information
jessemortenson authored Nov 16, 2024
2 parents bb7e0da + eb892d5 commit 59f35b6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scrapers/usa/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def scrape_amendments(self, bill, xml, session, chamber, bill_id):
if not amdt_url.startswith("http"):
continue
bill.add_document_link(
note=amdt_name,
note=amdt_name[:300],
url=amdt_url,
media_type="application/pdf",
)
Expand All @@ -453,7 +453,7 @@ def scrape_amendments(self, bill, xml, session, chamber, bill_id):
def scrape_cbo(self, bill, xml):
for row in xml.findall("bill/cboCostEstimates/item"):
bill.add_document_link(
note=f"CBO: {self.get_xpath(row, 'title')}",
note=f"CBO: {self.get_xpath(row, 'title')}"[:300],
url=self.get_xpath(row, "url"),
media_type="text/html",
)
Expand All @@ -468,7 +468,9 @@ def scrape_committee_reports(self, bill, xml):

url = f"https://www.congress.gov/{match.group('session')}/crpt/{match.group('chamber').lower()}rpt{match.group('num')}/CRPT-{match.group('session')}{match.group('chamber').lower()}rpt{match.group('num')}.pdf"

bill.add_document_link(note=report, url=url, media_type="application/pdf")
bill.add_document_link(
note=report[:300], url=url, media_type="application/pdf"
)

def scrape_cosponsors(self, bill, xml):
all_sponsors = []
Expand Down

0 comments on commit 59f35b6

Please sign in to comment.