views:

133

answers:

2

Can anyone direct me to a resource for getting up and running with the Facebooker plugin? The tutorial linked at the docs barely covers getting an app running, not actually using the API, the docs themselves are basically empty, and I can't find any references to basic API methods around the web, and those that I do find seem already out of date and obsolete. I am trying to do basic things like

  1. Determine whether the signature is valid
  2. Get the user info (like ID)
  3. Check whether the user has added the app
  4. etc.
A: 

Yeah the documentation is definitely lacking right now. You may want to join the google group and ask questions there. You can also look at the RDoc here: http://facebooker.rubyforge.org/

Here's how to do each of the things you want (I assume you're building a canvas application):

  1. This is done automatically by facebook. An error will be thrown if a user hits your app with an invalid signature.

  2. Use the fb_sig_user parameter. Like this: params[:fb_sig_user]

  3. If the fb_sig_added parameter is 0 then the user has not added your app.

You may want to print out all the parameters your application receives so you can see what's immediately available to you. (This will include the user's friends, a list of special permissions users have granted your application, their language setting, etc.)

Gdeglin
Is directly accessing the params really the best way to go? I thought there were various helper methods for accessing that info more cleanly...
floyd
In this case yes, accessing the params is probably the best option. Most of the helper methods relate to making API calls (which you don't need to do here), or rendering fbml markup.
Gdeglin
A: 

The best way to master Facebooker is to open the plugin and read the code! There's not much documentation out there so I learned how the gem works by reading the source. It's easy and well written code. Start with controller.rb and session.rb. Thats where youll find most of the method that you can use in your controllers.

I wrote a couple of blog posts about working with Facebooker. Maybe some of them will be useful to you!

Best of luck!

Pierre Olivier Martel