alex / nyt-2020-election-scraper

https://alex.github.io/nyt-2020-election-scraper/battleground-state-changes.html
MIT License
1.76k stars 289 forks source link

Prep work for generating results for all 50 states #351

Closed thomasdesr closed 3 years ago

thomasdesr commented 3 years ago
Motivation

It'd be nice for folks to have access to the data for all 50 states & DC.

Changes

This should have no impact on the current site, this is just laying the groundwork

  1. Adds flags for every state (From Wikipedia as well, also optimized)
  2. Not every state's data seems to have a per-count tot_exp_vote. So switches to trying that first and falling back to NYT's estimate at the state level if that isn't available.
  3. Not every state has more than one batch. So we need to make sure to grab the first batch's count, not the second.