Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] rest-graph 1.0.0 - super simple facebook open graph api client

Reply
Thread Tools

[ANN] rest-graph 1.0.0 - super simple facebook open graph api client

 
 
Lin Jen-Shin
Guest
Posts: n/a
 
      05-06-2010
=3D rest-graph 1.0.0
by Lin Jen-Shin (aka godfat-=E7=9C=9F=E5=B8=B8[http://godfat.org])
godfat (XD) godfat.org

=3D=3D LINKS:

* {github}[http://github.com/godfat/rest-graph]
* {rubygems}[http://rubygems.org/gems/rest-graph]
* {rdoc}[http://rdoc.info/projects/godfat/rest-graph]

=3D=3D DESCRIPTION:

super simple facebook open graph api client

=3D=3D FEATURES:

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

=3D=3D SYNOPSIS:

require 'rest-graph'

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

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

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

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

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

=3D=3D 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)

=3D=3D INSTALL:

> gem install rest-graph

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


=3D=3D LICENSE:

Apache License 2.0

Copyright (c) 2010, Lin Jen-Shin (aka godfat =E7=9C=9F=E5=B8=B

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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Facebook Graph API takeshi honda Python 2 02-19-2013 03:49 PM
[ANN] rest-graph 1.3.0 - A super simple Facebook Open Graph API client Lin Jen-Shin Ruby 0 06-11-2010 10:36 AM
[ANN] rest-graph 1.1.1 - A super simple Facebook Open Graph API client Lin Jen-Shin Ruby 0 05-21-2010 08:34 AM
super.super.super how? Java 24 02-24-2005 10:51 PM
GD::Graph: "mixed" graph doesn't recognize "area" graph type Emilio Mayorga Perl Misc 6 10-08-2003 02:14 AM



Advertisments