Facebook Cookbook - Jay Goldman [9]
Facebook Connect, launched in May 2008, takes the idea of Facebook Platform off-Facebook one step further by enabling you to include Facebook-like features in your own site. The topic is a little outside the reach of this book, but you can find more information on the Developers Wiki at http://wiki.developers.facebook.com/index.php/Facebook_Connect.
Facebook Platform Versus Google OpenSocial
Nobody likes a one-sided race: our competitive spirits take a beating at the unfairness of it all. Just when it looked like Facebook was going to single-handedly make a break for the cookie jar and steal all the cookies, competition popped up in the form of the OpenSocial Application Programming Interface (API). It’s important to take a moment to understand what that means to you, the would-be Facebook developer, so that you can feel secure in your decision to write apps for this Platform.
What Exactly Is OpenSocial?
With much fanfare, Google, along with a community of websites and developers, launched OpenSocial on November 1, 2007. Now that you have the gist of Facebook Platform, think about how much more powerful it would be if your Facebook apps could run inside lots of other websites too. The promise of OpenSocial is that you can build an app that runs on an ever growing list of sites including, MySpace, My Yahoo!, iGoogle, Friendster, h5, orkut, and others with little to no modification, giving you a potential audience of 600 million users (or three times the size of Facebook, though it should be noted that installation on one of those doesn’t guarantee or even cross-promote installation on others, and so the network effect of the social graph is tempered). Unlike Facebook Platform, you don’t need to learn a proprietary markup language. The OpenSocial API includes three major areas of functionality, accessible through both JavaScript and via data APIs:
People
Information about individual people and their relationships to each other
Activities
Ability to post and view updates on what people are doing
Persistence
A simple key-value data store to allow server-free stateful applications
That definition obviously leaves a great deal out, and it’s never wise to discount a specification backed by companies with more Ph.D.s per square foot than a NASCAR track has beer-drinking race fans. OpenSocial will evolve pretty quickly and is already beyond the scope of this subsection to describe, so you should take a few minutes to familiarize yourself with the information posted on the OpenSocial website (http://www.opensocial.org). Like many arguments in the tech industry, some of this is going to come down to a religious war (see Mac OS versus Windows, etc.). A fair chunk of the rest is going to come down to the seemingly eternal struggle between Open and Closed, with Google and friends crusading under the Open banner and characterizing Facebook as the dark lord of Closed. There is some truth to that position: OpenSocial apps will run on any website that implements an OpenSocial container, and their environment is built on open technologies such as HTML and JavaScript, whereas Facebook requires developers to learn