What have you found for these years?

2010-05-06

[ANN] rest-graph 1.0.0 released

= rest-graph 1.0.0
by Lin Jen-Shin (aka godfat-真常)
godfat (XD) godfat.org

== LINKS:

* github
* rubygems
* rdoc

== DESCRIPTION:

super simple facebook open graph api client

== FEATURES:

* simple graph api call
* simple fql call
* utility to extract access_token and check sig in cookies

== SYNOPSIS:

require 'rest-graph'

# every option is optional!!
rg = RestGraph.new(:access_token => '...',
:graph_server => 'https://graph.facebook.com/',
:fql_server => 'https://api.facebook.com/',
:accept => 'text/javascript',
:lang => 'en-us', # this affect search
:auto_decode => true, # decode by json
:app_id => '123',
:secret => '1829')
rg.get('me')
rg.post('feed/me', :message => 'bread!')

# for rack
lambda{ |env|
rg = RestGraph.new(:app_id => '123', :secret => '1829')
rg.parse_rack_env!(env) # auto save access_token if sig checked
rg.access_token # => ...
rg.data['uid'] # => facebook uid
}

# for fully blown cookies hash
rg = RestGraph.new(:app_id => '123', :secret => '1829')
rg.parse_cookies!(cookies) # auto save access_token if sig checked
rg.access_token # => ...
rg.data['uid'] # => facebook uid

# for fbs in cookies
app_id = '456'
rg = RestGraph.new(:app_id => '123', :secret => '1829')
fbs = cookies["fbs_#{rg.app_id}"]
rg.parse_fbs!(fbs) # auto save access_token if sig checked
rg.access_token # => ...
rg.data['uid'] # => facebook uid

# fql query
rg.fql('SELECT name FROM page WHERE page_id="123"')

== REQUIREMENTS:

* tested with MRI 1.8.7 and 1.9.1
* gem install rest-client
* gem install json (optional)
* gem install json_pure (optional)
* gem install rack (optional, to parse access_token in HTTP_COOKIE)

== INSTALL:

> gem install rest-graph
# or if you want rails plugin and bleeding edge
> script/plugin install git://github.com/godfat/rest-graph.git

== LICENSE:

Apache License 2.0

Copyright (c) 2010, Lin Jen-Shin (aka godfat 真常)

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

http://www.apache.org/licenses/LICENSE-2.0

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.

2 retries:

Poga Po said...

水喔 A_A

Lin Jen-Shin (godfat) said...

不過... 有趣的是,我一開始是因為不滿另一個 lib 才做的
裡面用了一套我沒聽過的 http lib, 我不喜歡

結果... 我現在在找 eventmanchine 的 http lib ><

Post a Comment

Note: Only a member of this blog may post a comment.



All texts are licensed under CC Attribution 3.0