MiniFB vs Koala vs Mogli - Facebook Graph Api Ruby Gems
There are a lot of gems for connecting to Facebook's API, and I've wound up using several of them. Here are my thoughts:
One of the first, and supports the graph api as well as the old REST api. If you think the REST api doesn't matter, think again. Last time I checked, there was still a fair bit of useful functionality that had not yet been migrated to the Graph API. So having both is pretty important.
The gem doesn't come with anything but API wrappers. So there are no partials to help you embed the javascript bits into your Rails app or anything. Frankly, if you're using the JS api, you really need to understand how all of that works anyway, so having the partials I don't find to be particularly helpful.
The return values you get from MiniFB are just deserialized JSON. This is really what you want, because the Facebook API changes quite frequently. Just deserializing the JSON means that you aren't constantly having to update your gem, or worse, fork and update.
Mogli (and Facebooker2)
Logging in to Facebook is tricky. There are a lot of edge cases. With MiniFB, you have to implement this on your own. Facebooker2 provides some help in that area. It requires Mogli. In a nutshell, Facebooker2 helps with authentication/authorization, and Mogli is the Graph client.
Facebooker2 does a great job. I can't really give Mogli the same recommendation though. The problem with Mogli is that they've tried to create classes around every conceivable Facebook component... except for when they don't. Occasionally it deserializes to Hashes. It's the worst of all worlds. When using custom classes, you lose data that the classes can't yet deserialize. You also wind up a warning sent out for every one of those fields. When you're using hashes, you're confused because you were just using classes a second ago.
I am using Facebooker2, which means Mogli is in my list of dependencies, but I'm no longer using it for my graph access. It was just too painful.
I've JUST switched to Koala. So far, I'm loving it! It has all of the advantages of MiniFB's simple serialization mechanism, but to that, it adds:
Documentation: MiniFB has docs, but they're not quite this complete
Finally, it appears to be more actively developed.
Verdict: Koala so far is the best Facebook gem that I have yet tried.
