Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steveklabnik/sunlight-congress
A wrapper for the Sunlight Foundation's Congress API
https://github.com/steveklabnik/sunlight-congress
Last synced: 7 days ago
JSON representation
A wrapper for the Sunlight Foundation's Congress API
- Host: GitHub
- URL: https://github.com/steveklabnik/sunlight-congress
- Owner: steveklabnik
- License: mit
- Created: 2013-04-08T04:36:55.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-12-28T22:09:25.000Z (almost 7 years ago)
- Last Synced: 2024-11-27T17:51:27.939Z (26 days ago)
- Language: Ruby
- Homepage: https://github.com/steveklabnik/sunlight-congress
- Size: 77.1 KB
- Stars: 36
- Watchers: 7
- Forks: 27
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Sunlight::Congress
[![Build Status](https://travis-ci.org/steveklabnik/sunlight-congress.svg?branch=master)](https://travis-ci.org/steveklabnik/sunlight-congress)
*The API this uses has been shutdown.* Follow [this post](https://www.propublica.org/nerds/congress-api-bill-subjects-personal-explanations-and-sunsetting-sunlight) for more information.
This is a wrapper for the [Sunlight Foundation's Congress API](http://sunlightlabs.github.io/congress/).
It is very much a work in progress, and only supports part of the API. Any
assistance with implementing extra calls would be appreciated!## Installation
Add this line to your application's Gemfile:
gem 'sunlight-congress'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sunlight-congress
## Usage
The first thing you need to do is set up an API key. You can apply for one
[here](http://services.sunlightlabs.com/accounts/register/). They're free and
have no usage limits.Once you have your key:
```ruby
require 'sunlight-congress'Sunlight::Congress.api_key = "lolthisisnotarealkey"
```Then, you can build various objects relating to the API. For example:
```ruby
Sunlight::Congress::Legislator.by_zipcode("90210")
=> [#