Facebook Cookbook - Jay Goldman [3]
This book is organized into 10 chapters:
Chapter 1, Introducing Facebook Platform
A general overview of Facebook, Facebook Platform, and an introduction to the incredible opportunity it represents.
Chapter 2, Ideation and Strategy
If you don’t have an idea in mind already for an app, this is the chapter for you. Learn about the Platform ecosystem, dig into the integration points and different strategies for using them, and pick up a few techniques for doing app design quickly and with the best possible results.
Chapter 3, Hello World
Time to get started building your first app! This quick chapter will walk you through the classic Hello World first programming example.
Chapter 4, Architecture and Design
This chapter covers the best architectures for Facebook apps, some solid recommendations for database performance, and an overview of the design and user experience of winning applications.
Chapter 5, Setting Up Your Environment
Learn about all the things you need to download, how to add apps to Facebook, the secret trick to setting up a test account, and how to get the lowdown on the latest and greatest from Facebook.
Chapter 6, Facebook Markup Language (FBML)
FBML is the magic that makes the Facebook Platform world go ’round. We’ll cover all of the tags, dig into some surprising behaviors you might encounter, and explore some great tricks for building better frontends.
Chapter 7, Facebook JavaScript (FBJS)
If JavaScript is the duct tape that binds the Web together, FBJS is the glue that makes Facebook apps stick (or something like that). This chapter explains why you can’t just use regular JavaScript in your app, how to build great Ajax-like interactions using Facebook’s Mock Ajax techniques, and goes into detail about all of the handy functions available to you.
Chapter 8, Facebook Query Language (FQL)
As FBML is to HTML, FQL is to SQL. We’ll take a look at the schema of the various database tables you have access to, and catalog some really useful (and fast) FQL queries you can use in your apps.
Chapter 9, Facebook API
Ah, sweet, sweet API. We would be nothing without you! This chapter will show you the real power behind Platform, digging deep into the code that connects everything together. We’ll go through each of the objects and methods you have at your disposal, and I’ll give you some tips and tricks for desktop apps along the way.
Chapter 10, Marketing Your App
Remember: if you build it, they won’t come—without persuasion. Marketing is the art of persuasion, and this chapter goes over some general marketing options for Facebook apps and some great techniques for measuring your success.
Code Samples
Many of the PHP code samples in this book require the Facebook API to be included and instantiated before the sample can be run. Those precious few lines of code have been omitted throughout to save space, so stick these in when you need them:
include_once 'resources/includes/config.php';
include_once 'resources/includes/facebook.php';
?>
global $api_key, $secret;
// Code Goes Here
?>
You’ll need to adjust the paths in the include_once lines to match where you’ve put the files after downloading them. See Chapter 5 for more information on setting up your environment.
Although there’s a lot of code in here that you could lift straight off these pages and drop into your app, remember that none of this has been extensively tested as production code and there’s very little error checking. Since Facebook throws exceptions when