This is a lightweight gem for the Donors Choose Api. It's dead simple to use. Donors Choose requires an api key to make requests. You can get your api key by sending an email to them at apikey[at]donorschoose[dot]org. However, you can start using the gem right away as the Api provides a default key, which is already built into gem. So, if no api key passed as an agrument, the default is used.
Also, to use the gem, just link to this github repo as there is another Donors Choose gem and I am too lazy to change my name at the moment.
In Rails: gem donors_choose, github: "verdi327/donors_choose_gem"
Add this line to your application's Gemfile:
gem 'donors_choose'
And then execute:
$ bundle
Or install it yourself as:
$ gem install donors_choose
The gem has three external method to interact with. It will return an instance of the Project class.
- DonorsChooseApi::Project.find_by_url("http://www.donorschoose.org/project/appletv-makes-classroom-tech-imazing/774020/")
- DonorsChooseApi::Project.find_by_url("http://www.donorschoose.org/project/appletv-makes-classroom-tech-imazing/774020/", API_KEY)
- DonorsChooseApi::Project.find_by_id('811882', API_KEY) #=> returns a project object
- @project.attributes #=> returns a hash of attributes
- :proposal_url
- :fund_url
- :image_url
- :title
- :short_description
- :fulfillment_trailer
- :percent_funded
- :cost_to_complete
- :total_price
- :free_shipping
- :teacher_name
- :grade_level
- :poverty_level
- :school_name
- :city
- :zip
- :state_abbr
- :latitude
- :longitude
- :state
- :subject
- :resource_type
- :expiration_date
- :funding_status
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request