0.01
No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
API client for the We The People petition application.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

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.