Search code examples
ruby-on-railsfacebookoauthgmail

finding friends in a rails app via facebook, gmail, twitter, etc


I have built a social networking app in rails, and am looking for a simple way to allow users to login to their various other accounts (OAuth?) such as facebook, twitter, gmail, other mail clients, etc and see if their friends/contacts on those sites are signed up for my site.

Additionally I will be adding functionality to allow users to invite their non-signed up friends to my site via these same sites.

In the future I will also want to make it so that users can post their submissions on my site to these various other sites.

At this moment though, the most important feature is enabling users to see which of their contacts on these other sites are signed up for my site.

What is the best way to go about this? What gems should I be looking for (OAuth, RFacebook, Facebooker, etc).

I am currently using restful authentication (Also, can someone point me in the direction of a question that answers how to allow users to sign in, using restful authentication, using their username OR their email?)

Thanks!


Solution

  • It's been ages since this was posted, but I felt it might be relevant to anyone who happens upon this question, the best way to do this is using the https://github.com/intridea/omniauth gem.

    For invites you should take a look at https://github.com/Diego81/omnicontacts.

    Also, if you are using a newer version of Rails and devise then you should check out this screen cast by Ryan Bates on using omniauth with Devise http://railscasts.com/episodes/235-devise-and-omniauth-revised.