A Ruby wrapper around the OpenSecrets.org API.
You will need to have an OpenSecrets.org API key before you can use this library.
See the OpenSecrets API documentation at : www.opensecrets.org/action/api_doc.php
This project was inspired by a project suggestion on the SunlightLabs.com website. If you would like to contribute please see : sunlightlabs.com/projects/opensecrets-ruby/
[sudo] gem install opensecrets
require 'rubygems' require 'opensecrets' require 'crack' require 'pp' # Note, you can also provide your API key in an environment variable for security and convenience. # export OPENSECRETS_API_KEY=YOUR_API_KEY # If you provide your key this way you do not have to provide a key in the OpenSecrets::*.new constructors. # A key provided to the constructor overrides any environment variable that is set. member = OpenSecrets::Member.new('YOUR OPEN SECRETS API KEY') pp member.pfd({:cid => 'N00007360', :year => '2008'})["response"] cand = OpenSecrets::Candidate.new('YOUR OPEN SECRETS API KEY') pp cand.summary({:cid => 'N00007360'})["response"] com = OpenSecrets::Committee.new('YOUR OPEN SECRETS API KEY') pp com.by_industry({:cmte => 'HARM', :congno => '110', :indus => 'F10'})["response"]
-
Project Home : github.com/grempe/opensecrets/tree/master
-
API Documentation : rdoc.info/projects/grempe/opensecrets
-
Report Bugs / Request Features : github.com/grempe/opensecrets/issues
-
Shoulda Tests. As there are currently none.
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history.
-
Send me a pull request. Bonus points for topic branches.
Copyright © 2009 Glenn Rempe. See LICENSE for details.