Introduction to Facebook Application Development
From Newscloud
In May 2007, Facebook introduced a platform to allow third party developers to write their own applications integrated into the social networking service.
Contents |
[edit]
Facebook Platform Documentation
[edit]
Facebook Platform Tools
[edit]
Facebook Platform Resources
- Facebook Application Code Examples See righthand sidebar.
- Google Analytics: Sign up to use statistics tracking from Google in your Facebook application.
[edit]
Setting Up Your Facebook Application
[edit]
Tracking Statistics
[edit]
Simple Facebook Example Framework Code
// Copyright 2007 Facebook Corp. All Rights Reserved.
//
// Application: Comedy Central Videos
// File: 'index.php'
// This is a sample skeleton for your application.
//
require_once 'facebook.php';
$appapikey = 'xxx';
$appsecret = 'xxx';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
// Greet the currently logged-in user!
echo "<p>Hello, <fb:name uid=\"$user_id\" useyou=\"false\" />!</p>";
// Print out at most 25 of the logged-in user's friends,
// using the friends.get API method
echo "<p>Friends:";
$friends = $facebook->api_client->friends_get();
$friends = array_slice($friends, 0, 25);
foreach ($friends as $friend) {
echo "<br>$friend"
}
echo "</p>";
« Back to Education Center home





