by Cardinal Blue http://cardinalblue.com
You can also read some other topics at doc
Various REST clients such as Facebook and Twitter built with [rest-
gem install rest-more
Or if you want development version, put this in Gemfile:
gem 'rest-more', :git => 'git://github.com/cardinalblue/rest-
:submodules => true
The simplest usage:
require 'rest-more' RestCore::Twitter.new.statuses('_cardinalblue') # get user tweets RestCore::Github.new.get('users/cardinalblue') # get user info linkedin = RestCore::Linkedin.new(:consumer_key => '...', :consumer_secret => '...') linkedin.authorize_url! # copy and paste the URL in browser to
linkedin.authorize!(’…’) # paste your code from browser
linkedin.me # get current user info
RestCore::Facebook.new.get('4') # get user info
Please see slides from [rubyconf.tw/2011] for concepts.
rest-more 1.0.0 – 2012-03-17
All clients are now asynchrony-aware. Asynchrony support is added in
rest-core >=1.0.0. Whenever you pass a callback block, the response
would then be passed to the block. Error handling is different, too.
In synchronous style, usually an exception would be raised, but in
asynchronous style, the exception would be passed to the block instead
of being raised.
Dropbox] Added Dropbox support.
codemethod to get the original error code.
codemethod to get HTTP status code.
Facebook::Error] Instead of passing
[true], pass error
result a serious call to the callback block, ending with a nil.
Config] Make sure the default attributes module is there even if
the config file isn’t presented.