Skip to content

brizandrew/wuft-election-2016

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WUFT Election 2016

WUFT had the results of the 2016 elections on its home page like many news organizations did and have for years. Unlike many local stations, we displayed live results for every contested race in our 13 county coverage area. The results were scraped and displayed using a custom scraper, API, and d3 charting system. The code for all these applications can be found in this repo.

The Page

The results page comes in two versions: a standalone HTML file and a Wordpress template file. You can see the archived version of these results on WUFT's 2016 Election Results page.

The Scraper

The scraper was able to get almost all the results autonomously. A person had to input those results manually because WUFT does not subscribe to an official presidential results feed. Furthermore, scraping the number of "counties reporting" for multi-county races did not work either. Because this was discovered after the scraper launched, my solution was to comment out that part and fill in the results manually. Since the 2016 election is over, I don't plan on revisiting that until the next election.

The API

The API was built to "translate" the data from a multi-table SQL format into a more javascript friendly JSON file. Instead of three tables with counties, races, and candidates, The API returns a single object with sections (i.e. counties, state, or national) which hold races and those candidates. The API can also be filtered by county using URL parameters.

About

Custom scraper, API, and d3 charting system for displaying live county, state, and national results in North Central Florida for the 2016 presidential election.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published