Entrepreneur's Playfield: Building Applications On Facebook Platform David Zhuang
Entrepreneur's Playfield: Building Applications On Facebook Platform David Zhuang
Building Applications on
Facebook Platform
David Zhuang
Overview
Open Distribution to Millions of Users
Architecture
Components
Resources
Open Distribution
Build It, And They Are Already There
• Developers: Equal Footing with Organizations
Left Canvas
Nav
Home Page: Viral Distribution
News
Feed
Left
Nav
Profile: Viral Distribution
News
Left
Feed
Nav
Profile
Box
Architecture: Traditional Web App
1. HTTP
Request Your Server
Web/App
Server
2. HTML SQL
Response Query Data
Database
Architecture: Facebook App - Canvas
2. HTTP
1. HTTP / REST Your Server
Facebook
Server Web/App
Server
6. HTML 3. API/FQL
SQL
Query Data
4. API Rsp
Database
5. FBML
Architecture: Facebook App - Profile
Database
Components
API
• Web Service API
• Client Library:
• Official: PHP, Java
• Unofficial: Perl, Python, Ruby, VB.NET, and others
FQL
• Similar to SQL
• Access to user profile, friend, group, event, and photo
FBML
• Similar to HTML
• Subset of HTML + Proprietary Extensions
API
Web Service API: Well Documented
API Client Library
• Mostly Covered by Web Service API Documentation
• For the Rest, Read Code (Only 2 Files)
• facebook.php
• facebookapi_php5_restlib.php
Access Facebook User Data
• Profile, Friends, Group, Event, Photo, etc.
Update User Views
• Profile, Feed, etc.
API Client Lib Function Examples
$facebook->redirect($url)
$facebook->require_login() / $facebook->require_add()
$facebook->get_login_url() / $facebook->get_add_url()
$facebook->api_client->feed_publishStoryToUser($title,
$body, ...)
$facebook->api_client->friends_get()
$facebook->api_client->friends_getAppUsers()
$facebook->api_client->profile_setFBML($markup, $uid=null)
FQL
Very Similar to SQL
• Select From One Table At a Time, No Join
• Query Must Be Indexable
Code:
<fb:dashboard>
<fb:action href="new.php">Create a new photo
album</fb:action>
<fb:action href="you.php">Photos of You</fb:action>
</fb:dashboard>
FBML Tags Example: Procedural Tags
Code:
David Zhuang
[email protected]