Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 11 commits ahead, 1032 commits behind arsduo:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
Manifest
Rakefile
init.rb
readme.md

readme.md

Facebook Graph

This Ruby client library is designed to support the Facebook Graph API and the official Facebook JavaScript SDK, which is the canonical way to implement Facebook authentication. You can read more about the Graph API at http://developers.facebook.com/docs/api.

Basic usage:

graph = Facebook::GraphAPI.new(oauth_access_token)
profile = graph.get_object("me")
friends = graph.get_connections("me", "friends")
graph.put_object("me", "feed", :message => "I am writing on my wall!")

If you are using the module within a web application with the JavaScript SDK, you can also use the module to use Facebook for login, parsing the cookie set by the JavaScript SDK for logged in users.

Testing:

Unit tests are provided for Graph API methods. However, because the Graph API uses access tokens, which expire, you have to provide your own token with stream publishing permissions for the tests. Insert the token value into the file test/fixtures/access_token, then run the test as follows: spec facebook_tests.rb

Unit tests for cookie validation will be provided shortly.