Tuesday, September 20, 2011

Learning Facebook Application Development





Table of Contents
Preface 1
Chapter 1: Getting to Grips with the Facebook Platform 5
The Purpose of the Facebook Platform 6
The Standard Web Application Model 6
The Facebook Web Application Model 7
The Facebook Platform Elements 8
The Facebook API 9
The Facebook API Test Console 9
FBML 15
The FBML Test Console 15
FQL 18
Obtaining the Facebook Client Libraries 19
Adding the Developer Application 25
Setting Up Your Application 26
Required Fields 27
Optional Fields 28
Base Options 28
Installation Options 30
Integration Points 31
Summary 32
Chapter 2: Building a Facebook Application 33
A Simple Facebook Application 33
Getting the Server Ready for Action 33
Creating Your First Facebook Application 34
The Application Initiation Code 34
The Application Code 35
Viewing the New Application 35
Developing the Simple Application 37
Examining Variables 41
Using FQL in Your Application 42
[ ii ]
Writing to the Facebook Profile 44
Updating the Facebook Cache 44
Mock AJAX and Your Facebook Profile 48
Using a Form on Your Profile 48
Creating a Dynamic Combo-Box 51
Limiting Access to the Form 54
Storing Data—Keeping Files on Your Server 56
Storing FBML on Your Server 56
Storing Data on Your Server 57
Summary 64
Chapter 3: Databases, Dashboards, and the Profile 65
Setting up the Database 66
Setting the Root Password 66
Creating the Database 67
Adding a User 67
A Table for Our Data 67
Migrating Data 67
Accessing the Database from Your Facebook Application 68
Connecting to the Database 68
Using a Remote Database 69
Running Queries on the Database 70
Obtaining Data from the Database 70
Inserting Data into the Database 72
Deleting Data from the Database 72
Analyzing the Database 73
Calculating the Number Items in a Table 74
Grouping and Ordering Data 76
Updating Everyone's Profile 78
Updating the Facebook Cache—Remotely 78
Obtaining the Application Session ID 78
Using the Session ID to Write to a Profile 79
Updating More Than One User's Profile 81
Automating the Facebook Cache Update 82
A Simple Batch File 83
Using At Command to Control the Batch File 84
Using Cron to Control the Batch File 84
Pros and Cons of the Methods 85
Tracking Users 85
A Table for Your Users 86
Finding Your Application ID 87
Adding New Users 87
Removing a User 89
Defining a Post-Remove URL 90
Producing a List of Users 91
The Facebook Dashboard 92
Adding a Dashboard 92
Adding Help to the Dashboard 93
Adding an Action to the Dashboard 93
The Dashboard Create Button 94
Facebook JavaScript 94
The Facebook Contextual Dialog 95
Summary 97
Chapter 4: Cooking User Data 99
How to Fetch User Data 99
FBML 100
fb:name 100
fb:pronoun 101
fb:profile-pic 102
fb:user 103
Logical Tags 104
fb:is-in-network 104
fb:if-can-see 104
fb:if-can-see-photo 105
fb: if-is-friends-with-viewer 105
fb:is-if-group-member 106
fb:is-own-profile 106
fb:if-is-user 106
fb:if-user-has-added-app 107
fb:if-is-app-user 107
FQL 107
Let's Have a Look at the Schema 108
JOIN as Sub Query 110
Effective Searching with Structures 112
Common Snippets 112
Find All the friends of a User 112
Find All Friends Who Have the Current Application Installed 112
Find All Friends Whose Birthday Is Tomorrow 113
Find Which Groups a Specific User Is Subscribed To 113
Find All the Photos Uploaded by the User and in Any Album 113
Functions You can Use in FQL 114
Using Facebook API to Retrieve Information 114
Retrieving Profile Information 115
Retrieving List of Friends 115
Finding Out If Some Users are Friends 116
Retrieving Group Member's Information 116
Retrieving a User's Photo 117
Facebook Developers Tool 119
Summary 122
Chapter 5: FBJS—The JavaScript 123
How FBJS Works 123
DOM Manipulation Using FBJS 125
DRY Means Don't Repeat Yourself 131
Managing Stylesheet with FBJS 132
Creating a Drop-Down Menu in FBJS 135
Dialog 138
Displaying Information 138
Accepting User Input 138
Contextual or Pop Up? 139
Advanced Input System Using Dialogs 140
Events 141
AJAX 143
Common Tasks 145
Posting Parameters to Server Side Code 145
Posting Multibyte Characters 146
Canceling an AJAX Request 147
Making Sure that Users have to Log In for the AJAX Request 147
Summary 147
Chapter 6: Feeds 149
What Are Feeds? 149
How to Publish Feeds 151
Sample Application to Play with Feeds 153
So How Did it Work? 157
Publishing News Feed 158
Difference between These Two Methods 163
feed_publishTemplatizedAction 163
Summary 165
Chapter 7: Invitations and Notifications 167
Invitations 167
fb:request-form 170
fb:req-choice 171
fb:request-form-submit 171
fb:multi-friend-selector 172
fb:multi-friend-input 172
fb:application-name 173
Notifications 174
notifications_send 174
notifications_sendEmail 175
Tips for Effective Notification and Emailing 177
Summary 177
Chapter 8: Photos 179
Photo API 179
photos_getAlbum 180
Accessing from an External Application 182
Uploading Photo 185
Tagging Your Photos 187
Slideshow Application 188
Summary 194
Chapter 9: Tools and Multimedia 195
Creating a Discussion Board 195
Taking Comments from Users 198
Making a Wall Using fb:wall 201
Increasing Usability Using fb:switch 202
Using fb:random to Display a Random Option 204
Increasing Usability Using fb:switch 204
Sharing Content 205
Audio Sharing 208
Video Sharing 208
Multimedia Contents 208
Displaying Photo 209
Managing Audio 210
Managing Video (FLV Format) 211
Summary 214
Index 215


Another Social Networks Books
Download

No comments:

Post a Comment

Related Posts with Thumbnails

Put Your Ads Here!