Skip to content

Fetch roll calls - #2267

Open
delexagon wants to merge 20 commits into
codeforboston:mainfrom
delexagon:fetch-rollcalls
Open

delexagon wants to merge 20 commits into
codeforboston:mainfrom
delexagon:fetch-rollcalls

Conversation

@delexagon

@delexagon delexagon commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Added a pipeline to fetch roll call votes.

Description

  • Creates a votes Firestore collection to store rollcall votes. The individual votes for rollcalls are collected into votes/${branch}-${court}-${number}/vote.
  • House rollcall votes are collected via PDF, by iterating through the endpoints at https://malegislature.gov/RollCall/${court}/HouseRollCall${number}.pdf.

Next steps

  • Currently, senate roll calls are fetched from the API. Unlike house roll calls, the API/pdfs do not have enough information to relate these roll calls back to the bills they affect. Committee votes would be useful to have in a searchable format, but these are also only present in bills. Therefore, although the house roll call scraping cannot be altered, both senate roll calls and committee votes should probably be fetched through the bill scraper instead.
  • Amendments are present in the Question field in the API, and are also listed in the Question field with my scraping procedure. When a roll call is based on an amendment, we may want to retrieve this amendment text as well and add some sort of flag.

Steps to test/reproduce

  1. Check that the created yarn firebase-admin run-script backfillRollCalls --env local --branch House --court 193 --number 3 works
  2. Check that the curl 'http://localhost:5001/demo-dtp/us-central1/triggerPubsubFunction?scheduled=scrapeHouseRollCalls' does not run into problems
  3. Can run yarn test for scrapeRollCall - small text extraction test

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
maple-dev Ready Ready Preview Oct 21, 2026 3:19am UTC

Request Review

@Mephistic Mephistic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this! Super annoying that there's not a great way to get a list of House Roll Calls, but given that roll calls monotonically increment from 1 by 1, I think your solution should work fine here.

I know we still have some changes outstanding per our discussion at the last hack night re: the Senate Roll Call scraper that we can discuss when they're ready.

Comment thread functions/src/votes/scrapers.ts Outdated
Comment thread functions/src/votes/scrapers.ts Outdated
Comment thread functions/src/votes/scrapers.ts
Comment thread functions/src/votes/scrapers.ts Outdated
Comment thread functions/src/votes/types.ts
Comment thread functions/src/malegislature.ts Outdated
Comment thread functions/src/votes/scrapers.ts Outdated
Comment thread scripts/firebase-admin/backfillRollCalls.ts
Comment thread scripts/firebase-admin/backfillRollCalls.ts Outdated
@delexagon

Copy link
Copy Markdown
Collaborator Author

Doing more testing rn

@delexagon
delexagon marked this pull request as ready for review October 14, 2026 03:16
@delexagon

delexagon commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

I can't seem to get the pubsubs to fire through curl, my own or previous ones. Is that a known problem with the v2 migration, or just something happening locally?

This branch was successfully deployed

1 active deployment
Preview – maple-dev — 1557caa1 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants