TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN:Scraping NY Times election data and displaying it on a flipdigit display

2 点作者 worldmerge6 个月前

1 comment

worldmerge6 个月前
Hi,<p>For the US 2024 Presidential election, I made a scraper that pulled the NY Times electoral college data and displayed it on my AlfaZeta flip-digit display. (Code [0])<p>It&#x27;s very hard to get free electoral college data live, but at Syracuse&#x27;s Open Data Day I learned the NY Times election data is just JSON files the whole site is powered by ~5 JSON files. So I got to work making a scraper for 2020&#x27;s data and formatting for my display. I built a websocket serial server that runs on a Raspberry Pi so I could work on my laptop and test it. [1]<p>At 6 pm (eastern) the new data dropped and that resulted in a URL for the JSON and a new data structure. I spent the next 20 minutes parsing it out and then let it ran for the whole night. I took a timelapse of the night (linked in the website)[2] and added back the click-clack sounds I heard that night.<p>[0] - <a href="https:&#x2F;&#x2F;github.com&#x2F;EdwardDeaver&#x2F;2024_Presidential_Election_Scraping">https:&#x2F;&#x2F;github.com&#x2F;EdwardDeaver&#x2F;2024_Presidential_Election_S...</a><p>[1] - <a href="https:&#x2F;&#x2F;github.com&#x2F;EdwardDeaver&#x2F;WeatherToMechanical">https:&#x2F;&#x2F;github.com&#x2F;EdwardDeaver&#x2F;WeatherToMechanical</a><p>[2] - <a href="https:&#x2F;&#x2F;vimeo.com&#x2F;1027074047" rel="nofollow">https:&#x2F;&#x2F;vimeo.com&#x2F;1027074047</a>