Add this line to your application's Gemfile:
gem 'monroe'
And then execute:
$ bundle
Or install it yourself as:
$ gem install monroe
There are currently three endpoints accessible from this wrapper:
Monroe::Articles
Monroe::Tweets
Monroe::Records
Monroe::Bills
To access the data from these endpoints, you will first need to request an API key and configure the client with this key. If you do not already have a key, you can generate one by querying the API's generator endpoint with your email as a parameter:
www.monroeapi.com/api_key?email=your_email@example.com
Once you have your key, you can configure the client by setting the key in an initializer file of simply at the top of your program:
Monroe.key = YOUR_API_KEY
Once the key is configured, you're good to go. Refer to the following documentation to access each endpoint.
To return all articles for a politician using their Congressional ID number:
Monroe::Articles.congressional_id('B001277')
To return all articles for a politician using their full name:
Monroe::Articles.name('Richard Blumenthal')
To return articles for all listed politicians in a given state:
Monroe::Articles.state('CT')
To return all tweets for a politician using their Congressional ID number:
Monroe::Tweets.congressional_id('B001277')
To return all tweets for a politician using their full name:
Monroe::Tweets.name('Richard Blumenthal')
To return tweets for all listed politicians in a given state:
Monroe::Tweets.state('CT')
To return all records for a politician using their Congressional ID number:
Monroe::Records.congressional_id('B001277')
To return all records for a politician using their full name:
Monroe::Records.name('Richard Blumenthal')
To return information regarding an individual bill given a bill number:
Monroe::Bill.number('HR1900')
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
####This gem is maintained by: Ben Winter Blake Ruddock Bryce Lambert