Skip to content

A source for data about the 2016 United States Presidential election. Includes a "candidates" endpoint.

License

Notifications You must be signed in to change notification settings

debate-watch/twenty_sixteen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TwentySixteen

Gem Version

A source for data about the 2016 United States Presidential election. Includes a candidates endpoint.

Installation

Add this line to your application's Gemfile:

gem 'twenty_sixteen'

And then execute:

$ bundle

Or install it yourself as:

$ gem install twenty_sixteen

Usage

Client-side

Request the hosted JSON data file.

Server-side

Candidates

List all candidates running for President.

candidates = TwentySixteen::Candidate.all

Filter candidates.

dems = TwentySixteen::Candidate.democrat

reps = TwentySixteen::Candidate.republican

indies = TwentySixteen::Candidate.independent

active_dems = TwentySixteen::Candidate.where({:party=>"Democrat",:campaign_status=>"active"})

party_nomination_winners = TwentySixteen::Candidate.party_nominee

Find a specific candidate.

hrc = TwentySixteen::Candidate.find_by_url("https://www.hillaryclinton.com/")

donald = TwentySixteen::Candidate.find_by_last_name("Trump")

Contributing

Edit candidate data in lib/twenty_sixteen/candidates.json. Please add new slogans in sequential order of appearance.

  1. Fork it ( https://github.com/debate-watch/twenty_sixteen/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

A source for data about the 2016 United States Presidential election. Includes a "candidates" endpoint.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages