[Facebooker-talk] ProfilePublisher support is now on GitHub

Mike Mangino mmangino at elevatedrails.com
Fri Jul 18 10:57:36 EDT 2008


Sorry all of this is coming so close to the new profile cutover. I  
want to get code out there as I integrate it.

I just added support for the new Profile Publisher: (http://wiki.developers.facebook.com/index.php/New_Design_Publisher 
)

There are just a couple of methods.

wants_interface? tells you whether or not Facebook is asking for the  
interface.

render_publisher_interface builds the JSON for the publisher interface  
specification.

render_publisher_response takes a UserAction (returned by your  
Publisher when you call create_method on a method that  
sends_as :user_action)

render_publisher_error(title,body) renders the JSON necessary for an  
error message.

Here is an example action that will be discussed in the next version  
of Developing Facebook Platform Applications with Rails:

   def index
     @defender = User.for(params[:fb_sig_profile_user])
     if wants_interface?
       render_publisher_interface(render_to_string(:partial=>"form"))
     else
       attack = Attack.new(params[:app_params][:attack])
       @attack = current_user.attack(@defender,attack.move)
       render_publisher_response(AttackPublisher.create_attack(@attack))
     end
   end


Mike

--
Mike Mangino
http://www.elevatedrails.com





More information about the Facebooker-talk mailing list