So many Facebook libraries for Ruby, which to choose? - ruby

So far I've come across the following Facebook API libraries for Ruby/Ruby-on-Rails:
Facebooker
Koala
Mogli
Facebooker2
fb_graph
facebook_oauth
I was wondering if anyone knows why there are so many, and if anyone has a rough idea of which to use when?

I did the same search recently and ultimately chose Koala. Facebooker was the clear choice a couple years ago, but it's out of date now with so many recent facebook api changes. Koala and fb_graph seem to be the most popular now. Koala is easy to use for accessing the graph api. I haven't used it for the older rest api, though Koala does support it. The only difficult part I've found is the facebook authentication with oauth - though that's probably facebook itself rather than Koala.
Relevant discussion here as well: Is fb_graph or Koala ruby gem better than facebooker2, using the facebook graph?

I have had the same problem : "which one to use ?" and i tried Facebooker, Mogli and fb_graph.
I can say that fb_graph is the best and the most mature and up to date and well documented ( you can read the facebook DOC and apply it to fb_graph. it works like magic).

Related

Rails4. Contacts importer from famous providers (Gmail, Facebook...)

Problem
Need to implement contacts importer/chooser on Rails4 project. Needed providers - Gmail, Facebook, Yahoo, LinkedIn, Outlook.
Researches
Tried omnicontacts and contacts gems but both has some limitations and maybe outdated for some providers.
There is commercial project which do this for you - CloudSponge , but I prefer open source.
Current Status
Implemented Linkedin contacts import using devise, omniauth, omniauth-linkedin.
Implemented Gmail contacts import using omnicontatcs.
Failed with other providers.
Queastion
Is there any other all-in-one solutions (maybe I missed something) which could be useful for my issue or I have to implement all things from scratch, maybe using already outdated gems/libs ?
Another thing I was thinking, maybe this task better to solve on client side using javascript libraries?
If you to try implement contacts importer in a do-it-youself way, the first goal will be proper learn OAuth2 and all the 4 authentication flows. I like this blog post explanation.
Then if you want to use a client-side-only solution for OAuth2, you'll need to use the Implicit flow.
For Google Contacts, you can find Implicit flow documentation here.
Disclaimer: I work for CloudSponge, and I'm a big fan of free/open-source solutions too. I even use Linux as my desktop :)

Making a Facebook API

First off let me state this is HOMEWORK for school. I am looking for general ideas and direction, not "this is exactly what to write". We did not really cover API's so I am trying to learn as I go.
I have been asked to design an API that can be used with Facebook, for things like posting on my feed or adding new friends. I have been doing tutorials online and most seem to have me add some "ruby gem" that has whatever websites methods and stuff. For example I did a Twilio.com demo that needed require 'twilio-ruby' and a twitter one that needed require 'twitter'. To my understanding, these are "gems" and not "API's" correct? That being said, is Koala an API or a simply a gem that contains the methods I need for writing an API (specifically for Facebook)? If I were to use Koala and it was an API, I feel that would sort of defeat the purpose of writing an API (just reusing their methods and such).
Any other ruby API Facebook help would be greatly appreciated!
Have a look at https://developers.facebook.com/docs/other-sdks Koala is listed as "other" SDK, meaning that it provides a wrapper around the low-level Facebook Graph API requests. So, no, it's not an own (web) API IMHO.
In a narrower interpretation, an API is just an "application programming interface". This would not necessarily have to deal with being accessible for example via a REST interface. I think it depends on the definition of API, respectively what you professor expects. If this is unclear, I'd check back with him/her.
Check
http://en.wikipedia.org/wiki/Api
http://en.wikipedia.org/wiki/Web_API
http://en.wikipedia.org/wiki/Representational_state_transfer

Google shared contact API

I am looking for Googoe Shared conatact API ruby gem.
Is there any good ruby gem for Google Shared Contacts API?
This is the only one I have found but it has not been maintained for a while. It might need some work.
This blog post has a discussion of how to do it on your own if you are interested (and it is more recent).

How to Generate twitter oauth_signature in Ruby

How to Generate twitter oauth_signature in Ruby, I am not using any library like(Oauth, Twitter, twitter_oauth)
Your question is quite ambiguos.
You should start by reading Twitter dev's documentation on OAuth. There's even an example there with the OAuth gem. I used this gem for my code too and was able to authenticate with Twitter's API. After trying out some solution, come back for more specific questions.
I made a small twitter command line app: you can have a look at the code to see a more complex example.

Multi authorization with CodeIgniter

I have my own CodeIgniter webapp.
I want to add to my site the multi-authorization from Facebook, Google, Twitter and OpenID sites.
(like here - https://stackoverflow.com/users/login)
Is it possible with CodeIgniter?
P.S. I've found some extensions for CI, but they are single and there is no way to merge them.
Facebook uses oAuth2
Twitter uses oAuth
StackOverflow uses OpenID.
Merging 3 entirely different protocols is not easy work, which is why no easy solution exists. You'll have to get your hands dirty for this sadly.
The closest you'll get is:
https://github.com/elliothaughin/socialize
That is not tested and I'm not sure if Elliot ever got around to finishing it.
What is used in Stackoverflow is called OpenID. Knowing the name, you can search for OpenID+CI implementations and you'll find a couple of libraries out there, and I guess this is the latest one.

Resources