Moving on, we are moving on the the presentation by Adrian Quek and Chee Tji Hun, both CodeCrew from Ablewise.com Free Classifieds. Chee for one is wearing singlet while Adrian is busy setting up the laptop.

 

Chee Tji Hun and Adrian Quek presenting

 

Firstly covered are the prerequisites for creating a facebook app.

  • A facebook account
  • Add the developer app at http://facebook.com/developers/
  • A web server to host the app

With the developer app added, claim a new application and filled in the call back url and the canvas page url. At anyone time, the developer can return to change the necessary variables.

Getting the API

  • Download the facebook platform tar. Google that and you shall find. http://developers.facebook.com/clientlibs/facebook-platform.tar.gz
  • Extract the tarball. (Duh!)
  • From the extracted file, just get the 2 files facebook.api and a facebook_api_php5_restlib.php into the application vendors folder in your cakephp setup. This is a talk is about developing a facebook app with cakephp remember?
  • And in the App_controller, declare a vendor call to the facebook/facebook vendor file and the cake setup is ready for calling the facebook api.

Adrian then touch upon the 2 necessary client functions:

  • facebook->require_login()
  • facebook->require_add()

Chee takes over form Adrian now and he breaks down the general facebook setup to a MVC pattern.

  • Logic: facebook api call
  • Model: FQL
  • View: Facebook markup language

He going on to explain how the breakdown will help developers who is intending to use Cakephp to divide up the work and modularize their development effort.

Useful client functions:

  • api_client->friends_get();
  • api_client->friends->getAppUsers()
  • api_client->friends_areFriends($uids1,$uids2)

Also for the third function, and according to facebook. you are not a friend with yourself. (Some laughter please)

Next he covers the FQL, a SQL styled query language that developers can use to query for data that is not covered in the basic api calls. And the structure of FQL is very much similar to SQL.

Lastly, he touch upon the facebook markup language which allow developers to create the interface that the end users see. And most of such interface are highly reusable across different apps.

  • Advantages of FBML
    • preserves the look and feel of facebook in your app
    • shortcuts to a lot of facebook information and functions
  • Disadvantages of FBML
    • subject to changes by facebook
    • less control over HTML actually displayed

He then used the invite page as an example. The reusable elements are the display friends’ pictures, the invite button and the skip button.

Of course, a plug for the app that these 2 gentleman had done. Check out “theman” app on facebook.