Rails app to work with Facebook/Twitter etc - ruby-on-rails

Apologies in advance for a rather non-specific question:
I am looking for some guidance on how 'best' to get a Rails app to talk to FB/Twitter etc and I see that there are options like Koala (https://github.com/arsduo/koala) for FB (and others for Twitter and so on.)
But then, there's also OmniAuth - which is for Authentication - but again for FB/Twitter/LinkedIn etc.
So how do the pieces of this puzzle fit together - do I need to use both OmniAuth and Koala for example if my Rails app needs to integrate with FB? Do I need just one? Is there something one uses OmniAuth for first and then Koala for the rest? A few sentences about the lay of the land here would really help me understand what each does and how they fit together.
Thanks!

Omniauth is simply an authentication library. It doesn't actually interface with the rest of the Facebook/Twitter/LinkedIn API. The only thing you do with it is bypass custom user profiles in favor of "Log In With Facebook".
Koala and other libraries similar to that are just rails-specific API interfaces. You can use them within your app to do deep integration into their Facebook or Twitter profile.

Related

API in Ruby in Rails like Twitter or Facebook

I've read multiple blogposts and watched the railscasts episodes to APIs. But I still got one problem, I'd like to use the API in a way Facebook or twitter does. It should be possible to register an API client. The client should become an id and an secret (should be the same like username or password, right?).
Somehow I think devise could do everything for me but I'm not sure cause I'm kinda new to rails.
Is there a best practice or is the devise solution a good and common one?
Thank you guys! <3
You should use the Doorkeeper gem. Here is a demo app using rails, devise and mongoid.
Booth that services use OAuth so if you want to implement similar functionality you can use this technology also.

Adding Facebook Authentication to Rails Custom Authentication

I am currently creating a rails application that requires authentication. Currently, I'm doing custom authentication like that shown in in the following railscast episode:
http://railscasts.com/episodes/250-authentication-from-scratch-revised
I would, however, like to add the option to also Log-in through facebook. After doing some research, I found that the easiest way to add Facebook login involves using Devise/Omniauth for authentication. Would it be worth it to try and switch my authentication system to Devise/Omniauth, or is there an easier way to add facebook authentication? I have also looked at the Facebooker plugin, but it seems very outdated. Any suggestions? I am relatively new to Rails, so I appreciate any help I can get!
I've used Authlogic and Devise in conjunction with Omniauth (+ facebook/google/twitter/etc). I found that Devise is the better solution for me with all it's built in functionality. Getting it to work with Omniauth was a breeze. There's a great Railscast here: http://railscasts.com/episodes/235-devise-and-omniauth-revised
I would definitely recommend going that route. Every piece of the pie is updated often and has great documentation so it should be easy to use for people still learning Rails.
Facebook authentication with Devise/Omniauth is mature, widely used, and well-documented. It would make sense to go with that.

Facebook Canvas App on Rails 3.1

I'm trying to create a Facebook canvas app that allow users to write a custom Wall post and tag some friends. I'm familiar with stand alone rails apps, but I'm having a hard time grasping API interactions.
I've came across with a few gems (Facebooker2, Koala and fb_graph) and the Heroku integration that provide a easier way to use the GraphAPI, but I wasn't able to find updated examples on how to integrate them with a rails app from scratch. So far, the only one that I've found was this sample from fb_graph.
It seems that this type of application is pretty common of Facebook, so I was expecting to find more info on the community. Is there a better way to start developing for Facebook using Rails or should I just pick one of those gems and stick with it until I grasp the concepts?
I was able to create an Facebook canvas app using the fb_graph sample. Probably there are better solutions to handle Facebook authorization inside canvas, but the sample is a great start. Here is my project, a Music Quiz inside Facebook: https://github.com/luizbranco/MusicQuiz
I built my first Facebook app from scratch using Koala. Their wiki on Github is absolutely fantastic and everything is well explained.

Are there any rails libraries to use with twitter oauth?

I'm looking for a plugin or a helper to help me with building a Twitter Rails app, stuff like signing in with Twitter, listing the users followers, etc. What is the best one out there?
Try using http://twitter.rubyforge.org/ I find it to be the one with the best documentation.
If you want to do more than simple API calls and go for user authentication as well look into
using devise with twitter https://github.com/MSch/devise-twitter
Railscasts has covered this in several episodes:
http://railscasts.com/episodes?utf8=%E2%9C%93&search=twitter
You can use
omniauth which can also cover services like github and facebook (if you feel like expanding)
https://github.com/intridea/omniauth
with the twitter strategy
omniauth-twitter (can't post link because of not enough rep, google it yo)
there are some railscasts that look over how you can integrate the two and this nettuts article which will give you an overall description of omniauth & providers
http://net.tutsplus.com/tutorials/ruby/how-to-use-omniauth-to-authenticate-your-users/

Rails 3 and Facebook share

in my app I want to have the "Share" Facebook thing in the items with a pre-defined message, so the user clicks in "Share" and gets redirected to the Allow/Deny page and after allowing, the pre-defined message is automatically posted in the user's facebook wall. What's the best gem for my problem(I am sure there is one :p)?
Thanks!
P.S: I looked at the facebooker gem but it seems out-of-date and I have to use the latest Rails 3.
Take a look at some related questions. Is fb_graph or Koala gem better than facebooker2? and Which Facebook Ruby API
I'm currently using a custom solution for our facebook integration but I have been looking moving to a gem and these seem to be the main choices:
koala
fb_graph
facebooker2
So far I agree with David from the "Which Facebook Ruby API" post and am leaning towards fb_graph because of its simplicity. It should handle your requirements without any problems, just take a look at the sample app.
koala seems to a better choice, as the remaining gems are outdated. Either they support the old facebook API or are not in active development.
I am successfully using koala with rails 3.
https://github.com/arsduo/koala

Resources