by Cardinal Blue http://cardinalblue.com
Various REST clients such as Facebook and Twitter built with rest-core
- Tested with MRI (official CRuby) 1.8.7, 1.9.2, 1.9.3, Rubinius and JRuby
- gem install rest-core
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
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
See example for more complex examples.
List of supported clients:
rib:A simple interactive shell with
You need to install rib in order to try this interactive shell:
gem install rib
Then you can try this by running
rest-core>> self.site = 'https://api.github.com/users/' rest-core>> self.json_decode = true rest-core>> get 'cardinalblue'
Which is using
RestCore::Universal for accessing arbitrary websites.
Apache License 2.0
Copyright (c) 2011, Cardinal Blue
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.