Skip to content

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

edwarddeaver.me
2 pointsworldmerge1 comment
On HN

Comments

Hi,

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])

It's very hard to get free electoral college data live, but at Syracuse'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'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]

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.

[0] - https://github.com/EdwardDeaver/2024_Presidential_Election_S...

[1] - https://github.com/EdwardDeaver/WeatherToMechanical

[2] - https://vimeo.com/1027074047

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.