API client for the White House's We The People petition application
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
we_the_people.gemspec

README.md

WeThePeople

we_the_people is a gem to access the new We The People petitions API.

Quickstart

Here are a few example calls:

>> petition = WeThePeople::Resources::Petition.find("1234")
>> petition.body
# => "Example body"
>> petition.title
# => "My Example Petition"
>> petition.issues.first.name
# => "Civil Rights"

>> petitions = WeThePeople::Resources::Petition.all
>> petition2 = petitions.first
# Not yet implemented in the API (signatures)...
>> petition2.signatures.all.first.city
# => "Orlando"

Configuration

You can configure a few options on the WeThePeople module:

  • api_key - Your We The People API key (optional).
  • default_page_size - The page size to request by default for all resources.
  • client - If you don't want to use rest-client you can substitute in another HTTP client object that conforms to the same API here.
  • mock - If set to "1", all requests will return mock results.

Contributing

Hack some code, make a pull request. I'll review it and merge it in! Need some ideas as to where to get started? Here are a few:

  • Tests. Please?
  • Make resources be able to be related + associated. It looks like responses may end up going this route.
  • Documentationages.