简体   繁体   中英

Rails and Facebook connect API (graph).

I am developing in Rails 3 and I need to use the Facebook connect API (Graph). I am currently trying out the Javascript SDK and it works fine. The problem is I do not know how to "save" and interact with the information I extract in Rails.

The best thing would be to use some "native" Rails plugin for Facebook. I have looked a bit on the Facebooker Plugin but I do not know how to get started and use it.

Does anyone know how to interact with the Facebook API with Rails 3?

Facebook Graph API is HTTP based, so it works with any language that has an HTTP library, such as cURL, urllib. Just call appropriate url with appropriate data and you will get you data as JSON object.You can use facebook explorer tool for sandbox testing of your api. For rails koala gem just makes it easy to call API and extract info from response .

You would need to integrate some kind of server-side logic. For instance, you could use your own JS to call FB's JS and then AJAX submit the data received back from FB to your server for persistence.

Then, you could use something like koala to make server side calls later to the OpenGraph API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM