Christoffer
Christoffer

Reputation: 2411

Rails and Facebook - can I do this?

I am considering implementing a Facebook-integration to my web app. I want to be able to import friends names, their ages and their interests/likes.

A. First off, is this possible? Can I access this information?

This import will, more or less, be a one-time import.

I also want to be able to use Facebook-login and to use it parallell to my "normal" login (auth) functionality. I assume this should be quite straightforward since most websites have it this way (e.g. Fiverr.com).

B. These two things being my basic needs of my Facebook-integration, which gem would you recommend me to use?

C. I am 1 1/2 years into RoR and consider myself decent at Rails-programming but hardly know any JavaScript and very little jQuery. Will this integration be very difficult for me, you think?

Receommendations of useful blog posts etc will also be appreciated!

Upvotes: 1

Views: 257

Answers (1)

ksol
ksol

Reputation: 12235

A. Check facebook doc on permissions. I'd say you can get a user friends list (id and names), but nothing more : the friends would have to allow your app in order for you to retrieve their data. I've stumbled upon this issue a few weeks ago, but we were retrieving albums and pictures. The data you want is less sensitive, so maybe you can do it anyway. Bottom line : check.

B. I'd suggest using devise for managing everything related to authentication. It is a well known gem, used by many and more. You can add support for facebook via omniauth; there's a wiki page on devise about how to achieve this.

C. Once you get your grasp around the OAuth concepts, you'll be good. You can use facebook connect without javascript/jQuery. Some features though, as the "like button", will require to use the js SDK. Besides these ones, you can do pretty much everything server-side. For more advanced queries, the koala gem can do that.

Hope this is enough for you.

Upvotes: 2

Related Questions