Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop API calls for Press statements #35

Closed
aih opened this issue Oct 20, 2020 · 4 comments
Closed

Develop API calls for Press statements #35

aih opened this issue Oct 20, 2020 · 4 comments

Comments

@aih
Copy link
Collaborator

aih commented Oct 20, 2020

Derek Willis may be able to point to the sources

@aih aih added the scraping label Nov 17, 2020
@aih
Copy link
Collaborator Author

aih commented Jan 27, 2021

@nkinaba nkinaba added this to the Understand the Context Section__Bill Page milestone Feb 4, 2021
@aih
Copy link
Collaborator Author

aih commented Feb 9, 2021

From Josh:

Bill number regex:

I realized I have a slightly different use case so I had to adapt the regex I use for what you would use with e.g. searching a CRS report's text. Hopefully I did it right:

bill_number_re = re.compile(r"(?P<type>h\.? ?r\.? ?|s\.? ?|h\.? ?con\.? ?res\.? ?|s\.? ?con\.? ?res\.? ?|h\.? ?j\.? ?res\.? ?|s\.? ?j\.? ?res\.? ?|h\.? ?res\.? ?|s\.? ?res\.? ?)(?P<number>\d+)", re.I)
def parse_bill_number(text):
    m = bill_number_re.match(text)
    if not m: return None
    return {
        "type": m.group("type").lower().replace(".", "").replace(" ", ""),
        "number": int(m.group("number"))
    }

Press statements for a bill:

Example function to call the propublica API plus some custom logic that tries to pick out a few key press statements:
https://github.com/govtrack/govtrack.us-web/blob/master/bill/views.py#L138

@JoshData
Copy link
Member

@ayeshamk ayeshamk self-assigned this Feb 24, 2021
@ayeshamk ayeshamk changed the title Build scraper for Press statements Develop API calls for Press statements Mar 24, 2021
@aih aih modified the milestones: Understand the Context Section__Bill Page, Week of March 23, 2021, Week of March 30, 2021 Mar 24, 2021
@aih
Copy link
Collaborator Author

aih commented Apr 3, 2021

This is working now, with AJAX calls from the UI.

@aih aih closed this as completed Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants