rest-more https://github.com/cardinalblue/rest-more
by Cardinal Blue http://cardinalblue.com
Lin Jen-Shin (godfat) had given a talk about rest-core on
RubyConf Taiwan 2011. The slide is in English, but the
talk is in Mandarin.
You can also read some other topics at doc
DESCRIPTION:
Various REST clients such as Facebook and Twitter built with [rest-
core]
INSTALLATION:
gem install rest-more
Or if you want development version, put this in Gemfile:
gem 'rest-more', :git => 'git://github.com/cardinalblue/rest-
more.git’,
:submodules => true
SYNOPSIS:
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
authorize
linkedin.authorize!(‘…’) # paste your code from browser
linkedin.me # get current user info
RestCore::Facebook.new.get('4') # get user info
Runnable example:
https://github.com/cardinalblue/rest-more/blob/master/example/simple.rb
Please see slides from [rubyconf.tw/2011] for concepts.
CHANGES:
rest-more 1.0.0 – 2012-03-17
Enhancement
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. - [
Bing::Error
] Addedcode
method to get the original error code. - [
Twitter::Error
] Addedcode
method to get HTTP status code. - [
Facebook::Error
] Instead of passing[true]
, pass error
messages. - [
Facebook
] Pages related API is reimplemented. Passing a block
would
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.