Foauth
foauth.org Ruby client built on top of faraday.
Installation
Add this line to your application's Gemfile:
gem 'foauth'
And then execute:
$ bundle
Or install it yourself as:
$ gem install foauth
Usage
Create a new client passing in your foauth email and password.
client = Foauth.new('[email protected]', 'secret')
When you make a request to one of the supported foauth services the url will automatically be converted to a foauth url using the hostname and the path.
response = client.get('https://api.twitter.com/1/statuses/user_timeline.json')
# An authenticated request is made to https://foauth.org/api.twitter.com/1/statuses/user_timeline.json
puts response.success? # true
puts response.body # [{"created_at":"Mon Dec 31 23:59:13 +0000 2012"...
puts response.status # 200
The client returned is an instance of Faraday::Connection and the
response is an instance of Faraday::Response. See faraday for
more information.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Credits
Inspired by requests-foauth by @kennethreitz.
Copyright (c) Chris Mytton