Automatically update poll data - #8
Conversation
|
@Wouter8 is attempting to deploy a commit to the Personal Team on Vercel. A member of the Team first needs to authorize it. |
|
Wow, amazing approach and this could have saved us some manual work. Thank you so much for contributing to this project! Unfortunately the timing for this PR is not ideal. The final three predictive polls we are using were published yesterday and I just did a final update of all numbers. Tonight I will be manually switching from using the 3 polls to a single exit poll by Ipsos, and when the official results of the election are made available we will switch to those. This means an automated way to import the predictive polls will not be used for a while... In the lead-up to the next general elections in the Netherlands, I will be hopefully revisiting this project and it is hard to predict at the moment whether the same polling organizations will be most relevant and whether Wikipedia's way of structuring the data will remain the same. I therefore suggest keeping this PR open for now, until the next elections are planned... Which will take 4 years (at most). Thank you again for this contribution, looking forward to having this working for the next elections. |
|
Totally understand your comment. A couple days ago I stumbled upon your site and sometimes I saw newer poll results on Wikipedia, while the website was not updated yet. Then I saw that you were manually updating these results which I thought could be improved :). The Wikipedia page should include all polls, including the exit poll, so maybe we should make this more configurable. Currently the 3 organizations are indeed hardcoded. I agree that fine tuning this for the current Wikipedia page is not the most sensible, as it will become obsolete later today. I'm fine with leaving the PR open and revisiting this for the next elections (let's hope it is in 4 years...). Thanks for the cool site! |
This pull request adds automated polling data updates to the project by introducing a poll data importer tool, updating data structures and UI to display dynamic poll metadata, and integrating a scheduled GitHub Actions workflow. The main themes are automation of poll data updates, codebase and data structure changes, and user interface improvements.
Automated Poll Data Import and Update:
tools/importer/that fetches the latest Dutch election poll data and metadata (dates, URLs) from Wikipedia, parses it, and updatessrc/parties.jsaccordingly. The importer usesaxiosandcheeriofor scraping and parsing, and includes validation and error handling. (tools/importer/scraper.js,tools/importer/package.json,tools/importer/README.md,tools/importer/.gitignore) [1] [2] [3] [4].github/workflows/update-polls.yml) to run the importer automatically on a configurable schedule, enabling regular, hands-off updates of poll data. (.github/workflows/update-polls.yml)Codebase and Data Structure Changes:
src/parties.jsto support dynamic poll data and metadata, replacing hardcoded poll results and static metadata with newpollsandpollMetadataobjects that are automatically updated by the importer. (src/parties.js)User Interface Improvements:
pollMetadatafromsrc/parties.js, and updated the UI to display poll sources, dates, and URLs dynamically, instead of hardcoded poll links. (src/components/App.js) [1] [2]Documentation Updates:
tools/importer/README.md)README.mdto explain the new automated poll update process and reference the importer tool. (README.md)