Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/technicalpickles/daywalker
A Ruby wrapper around the Sunlight Labs API using httparty and happymapper
https://github.com/technicalpickles/daywalker
Last synced: 3 months ago
JSON representation
A Ruby wrapper around the Sunlight Labs API using httparty and happymapper
- Host: GitHub
- URL: https://github.com/technicalpickles/daywalker
- Owner: technicalpickles
- License: mit
- Created: 2009-02-04T04:22:05.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2010-02-23T05:16:17.000Z (almost 15 years ago)
- Last Synced: 2024-09-22T06:08:35.449Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 277 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= daywalker
A Ruby wrapper for the Sunlight Labs API: http://wiki.sunlightlabs.com/Sunlight_API_Documentation
= DEPRECATED
This gem is no longer under active development. THe official gem would be abetter place to go:
* http://github.com/sunlightlabs/ruby-sunlightapi
== Install
# Run the following if you haven't already:
gem sources -a http://gems.github.com
# Install the gem(s):
sudo gem install technicalpickles-daywalker== Get an API key
Before starting you need to register for an API key: http://services.sunlightlabs.com/api/register/
After registering, you will receive an email prompting you to activate the API key.
== Examples
require 'rubygems'
require 'daywalker'
require 'pp'Daywalker.api_key = 'this is so sekrit'
pp Daywalker::District.all_by_zipcode('27511')
pp Daywalker::District.unique_by_latitude_and_longitude(40.739157, -73.990929)
pp Daywalker::District.unique_by_address('One City Hall Square, Boston, MA 02201')
pp Daywalker::Legislator.all_by_zip('02201')
pp Daywalker::Legislator.unique(:state => 'NY', :district => 4)
pp Daywalker::Legislator.unique_by_state_and_district('NY', 4)
pp Daywalker::Legislator.all(:state => 'NY', :title => :senator)
pp Daywalker::Legislator.all_by_state_and_title('NY', :senator)
== FAQ
Q:: Why not use the existing gem, available at http://github.com/luigi/sunlight/tree/master ?
A:: Mostly, I didn't have a good experience when I was first poking around the Sunlight Labs API. I was dense and didn't activate my API key at first, but it didn't notice that. Even after activating, I wasn't getting any data back.== COPYRIGHT
Copyright (c) 2009 Josh Nichols. See LICENSE for details.