Skip to main content

Posts

Showing posts from May, 2013

Facebook Scores API with Koala Gem

Here is a code snippet for a piece of code that I found a lot of people asking about on the web. Since Koala gem does not have an explicit API for Facebook Scores API , some people wonder why it isn't there. Actually, there is a generic call that can do the job just fine: After getting your Koala gem to work: check this URL for more about Creating a Facebook Rails app with Koala gem . Read the set of scores for a user and their friends Facebook Scores API states that: "You can read the set of scores for a user and their friends for your app by issuing an HTTP GET request to /APP_ID/scores with the user access_token for that app." So this can be done with the 'get_object()' method, api = Koala::Facebook::API.new(session[:access_token]) scores = api.get_object(APP_ID + "/scores") Create or update a score for a user: Facebook Scores API states that: "You can post a score for a user by issuing an HTTP POST request to /USER_ID/...