NY Times Congress =============== A Ruby wrapper for the New York Times Congress API. --------------------- The NY Times has graciously been scraping the web for data related to the United States Congress! This is a Ruby library and command-shell intended to make it even easier to get at that data and turn it into useful information. Introdushing Congresh --------------------- The Congress Shell (congresh for short/cute) is a simple interactive prompt for interacting with the API. It provides a few conveniences to make it easy to get at the current chambers of congress. Congress.new --------------------- You get a Congress object either by calling Congress.new with the session and chamber, or by using the Senate and House constants which return the current session of each: current_senate = Senate current_house = House 2007_senate = Congressnew(109, 'senate') 2008_house = Congress.new(110, 'house') Through a Congress object, you can get a list of its representatives as a hash, keyed by congressional Bio ID. senators = Congress.new(111, 'senate').members Legislator --------------------- hillary = senators.values.find {|legislator| legislator.name == "Hillary Clinton"} or hillary = senators['C001041'] For full details on Bios and roles, use: Legislator.find('C001041') Roll Call Votes --------------------- To find a vote in any congress, you need to know the session (usually 1 or 2, although rarely congress will go into a 3rd session) and then the ID of the vote: Senate.roll_call_vote(session_number, vote_number) You can also find recent votes for any given senator: hillary = Legislator.find('C001041') hillary.votes Acknowledgements --------------------- All information made available through this software is generously gathered and hosted by the New York Times (read Terms of Use below). Inspiration and code was borrowed from the excellent nytimes-movies gem written by Jacob Harris and the sunlight gem by Luigi Montanez. Thanks to Marcel Molina, Jr. for pairing with me on the lazy-loading idea. Terms of Use --------------------- All information made available through this software is generously organized and hosted by the New York Times and is subject to copyright. By obtaining an API key throught their Developer program and accessing this data you are agreeing to abide by certain rules and restrictions. These are available at the URLs below and you should read them before proceeding: http://developer.nytimes.com/attribution http://developer.nytimes.com/Api_terms_of_use License --------------------- Copyright (c) 2009 Patrick Ewing Made available under the MIT License (read LICENSE for details).