by : Shaomei Wu
You might want to know…
* How to create a Facebook App?
* How to get data using Facebook Platform?
Guide to Create a Facebook App
http://developers.facebook.com/step_by_step.php
* Add the Developer Application
* Get a web server and/with a database service (if you will use database) – Thanks Chris!
* Create a new App in Developer
* Configure your App:
o The form is explained very clearly at: http://developers.facebook.com/step_by_step.php
A very quick start
? define Facebook Class
? given after you create a new App
Step-by-step Guide to Creating Facebook App
http://developers.facebook.com/step_by_step.php
Extract data with your App
http://developers.facebook.com/documentation.php
Facebook APIs
http://wiki.developers.facebook.com/index.php/API#API_Methods
* A lot of handy functions provided with a Facebook Object.
* For example: Users.getInfo
o Returns a wide array of user-specific information for each user identifier passed, limited by the view of the current user.
Examples of using APIs
* Get current user’s first name and last name
$user_details=$this->facebook->api_client->users_getInfo($uid, array(‘last_name’,'first_name’)); $data['first_name']=$user_details[0]['first_name']; $data['last_name']=$user_details[0]['last_name'];
Facebook Query
http://wiki.developers.facebook.com/index.php/FQL
* Facebook Query Language, or FQL
o allows you to use a SQL-style interface to more easily query the same Facebook social data that you can access through other Facebook API methods (assuming your application has access!).
* It can be very concise and powerful!
Examples of using FQL
http://wiki.developers.facebook.com/index.php/Sample_FQL_Queries
* Get the names of the groups of which u1 is a member:
SELECT name FROM group WHERE gid IN (SELECT gid FROM group_member WHERE uid = ”u1”)
* In PHP, you write:
$query = “YOUR QUERY HERE”; //(see above examples)
$array = $facebook->api_client->fql_query($query);
* The returned array is multidimensional, so
$attribute = $array[0]['attribute'];
* If there are no rows returned, check to see if there are any results like this:
if ($result != NULL)
Popularity: 5% [?]
Tags: Application programming interface, Data, Facebook, Facebook App, Facebook Platform


