How to integrate Facebook in Rails - ruby-on-rails

I hava a Rails application, I need to integrate Facebook. User can login with Facebook account and get his reviews in facebook and so on, how to deal with this case in rails? thanks!

Facebooker is no longer supported I recommend using Koala gem: https://github.com/arsduo/koala/wiki

There is a very comprehensive article here: http://www.packtpub.com/article/facebook-application-development-ruby-on-rails
And several existing plugins for this purpose like 'rfacebook', 'facebooker' or 'facebook-rails'. 'Facebooker' definitely has Facebook Connect abilities.

Related

Rails app with two kinds of login

I have created a rails app with my own login system, and now I would like the user to be able to login with the facebook API (omniauth) aswell.
So how do I implement this, so my users will be able to create or login with my version and be able to login with facebook?
Can they work on the same database or do I need two separate?
Any guides you can recommend?
This is covered in this Railscast: #241 Simple OmniAuth.

Posting to Twitter from Rails app with omniauth

I’m set up devise and omni-auth for both twitter and Facebook and now I’d like to allow users post a tweet or Facebook post from my app. I’m looked all over and confused on where to start for this. For right now I just want it to be a dummy post, doesn’t need to include anything from my rails app.
If you are looking for an example app for posting on twitter then you may check it out here with a working app posting on twitter:
https://github.com/railscasts/359-twitter-integration
Hope you may find it useful
To post tweets on Twitter you can go for Twitter gem.
Read the documentation here
For Facebook you can go for Koala gem
Read the documentation here

Rails - How to access Facebook wall posts of a user

I am building a Rails site for a friend. It is mainly going to be a static website with a few exceptions. On the homepage I would like to display the latest Facebook wall posts from a Facebook user's profile, that way my friend can post a status update on Facebook and it will be reflected on the homepage of the website. What would be the best way to go about implementing this? Should I be using the Facebook Graph API or be looking for a Facebook Ruby gem or is there some other way of doing this? Can someone please tell me what I should use to do this task? Thanks!
you may look into http://facebook-ruby.sourceforge.net/ or http://rfacebook.rubyforge.org/

rails facebooker vs facebook js sdk

I am exploring facebook integration with my rails app and wondering what is the best practice for rails applications.
1 - Is js sdk the better route or the facebooker gem? I would like to allow users to login via facebook, post content/links to their walls, see friend activity in the application, invite fb friends, from the rails app etc.
2 - Can either of these methods be tested locally or do I need a hosted internet app?
3 - I already do fb authentication for login using janrain/rpx-now via authlogic-rpx plugin. Will this have any conflict with the facebooker gem or the fb js sdk. And..in order to use the fb pluging/js sdk/facebooker etc, is it required to do the authentication via those methods or can I authenticate via rpx/janrain but access feeds/friend activity etc from the facebooker gem/js sdk etc?
Thanks
1) I often use both. I find most of the work to be easier using the server side SDK, but we do occasionally use the js one as well. I would check out Facebooker2, it's much more simple than the original Facebooker
2) Both can be used locally, but you do need internet connectivity to talk to Facebook.
3) If you get a valid access token, you can use Facebooker with the RPX stuff. You would need to change the way you do the client setup.

Google Apps Authentication for a Rails App

I'm currently using Authlogic to handle all user accounts, but our company has switched over to Google apps and I would much rather use that same authentication for all users.
My question is - how?
I know I'll need the ruby-openid gem but I have yet to integrate authentication with a 3rd party. Any recent examples or tutorials out there to help guide the way?
Thanks!
There is a good resource here that I've used to get this working in the past.
This does what you are looking for: authlogic_openid_selector_example. It isn't a tutorial but you can have a look at the code.
Seth Ladd, a Google developer advocates, has a blog post on how to authenticate using a google account in a rails 3 appl. You may need to change the example depending on how google apps is configured in your company.
Just a thought -- RPX has the ability to do logins from google, and you could use the Authlogic RPX plugin

Resources