2 Jun
Mike Mangino: Facebook development and performance with Rails
Mangino explains how to create a Facebook application with Ruby on Rails optimizing the performances.
He explains how a Rails application can integrate through Facebook, practically Facebook acts being of the kind which a proxy between the user and the application (infectious the requests from the user to the application) this can create more probelms; the most dangerous: cropped land HTTP request originates from Facebook, not from the user that created it.
The session continues with a live demo concentated on the creation of a facebook application that shows on the page a RailsConf Badge.
The first thing to do is to create a Facebook application e registering it with using the form. Therefore you must do it in a way that Facebook speaks to the server where the application is on. To do this it is necessary to make a tunneling operation, that will open up a few ports without ceasing the firewall and utilizing tunnir.
Once the application is created with the usual genrator ‘rails’ it is necessary to install the plugin facebooker e configurare using the facebooker.yml file.
This is what Facebooker does by reason of us:
- manages the pass of parameters e certifies that each request comes from facebook
- re-integrates the possibility to use the architecture REST to develop facebook applications
- and much to a greater degree!
The configuration file of facebook comprises the signature of the application and some information in all parts of tunneling.
To launch the application that has due been created the following commands are run:
ruby script/server rake facebooker:tunnel:start
Another facebook turn of expression is the FBML (Facebook Markup Language) that gives the contingency to show a video some information relative to the user that is navigating in our application with an HTML-like mention. L’FBML also contains some helper for the drafting of the interface so that they have the look and feel of facebook.
Lets proceed with the drafting of the test application:
Installing a facebook application in the profile makes it in a room for passing that the application can adit to the characterisctics of the user who is using the application as hearty in the manner that sending this user notification emails.
‘ensure_application_is_installed_by_facebook_user’ placed in the controller will make it accessible only admitting that the assiduity has been installed.
Facebook makes it possible to know the characteristics of the user that is using the application through the parameters ‘fb_dig_user’. Following the method profile_fbml = you can update the profile of the user that is connected.
Be aware that developing in this environment it important that the urls must contain the absolute path.
Using the facebook publisher we can in facebook have (or well-nigh) the functionality that a normal application can have with ActionMailer.
The most potential component in facebook is SocialGraph, that allows you to portray the collected information from my application, using the social function that can give problems to play, to remedy this you can conversion to an act REF, that works like a persistent lection of memcached. To use REF, you can use the following syntax:
<fb:ref handle="<%=dom_id sess%>" ecc...
Lastly he says that using the Facebooker API REST does not have such a benevolent act.
Annalisa
