Spiga

A Quick Look At Facebook's Open Source

The other week, when representatives from Facebook mentioned that they'd be open-sourcing significant portions of their platform, I hazarded a guess that they would be providing at most a set of APIs. Now that Facebook's actually released some code under the aegis of the Facebook Open Platform, I had a look-see. To my delight, I saw more than just APIs.

Once you download the code and unpack it, the first thing that will probably draw your attention is the README file: "This package contains the basic functionality needed to implement and expose the Facebook platform, including support for the Facebook API, FQL, and FBML." Also included is a list of ingredients you'll need to bake your own Facebook cake -- PHP 5, Apache 1.3 or a Web server that supports some of the same basic functionality, MySQL, and the optional but useful Thrift binary.

One thing I looked at most closely was the licensing. The majority of the code is not under the GPL but instead a slight variant of the Common Public Attribution License -- which is an OSI-approved license all the same. The changes: a) you have to attribute Facebook to the original work, and b) making the code into a Web service counts as distribution. The latter is, I take it, Facebook's way to close the ASP loophole and prevent its work from being capitalized upon unfairly. (Thrift, Facebook's platform for cross-language services, is available under its own licensing, which is reminiscent of the MIT license ... although that does make me wonder why they bothered with their own iteration of the license save for the sake of brand recognition. Wait, that's it!)

Facebook's open source projects aren't limited to opening up their platform per se. Other goodies include a Firefox toolbar -- something that you could use as a learning tool for building your own such add-on; I know I plan to -- as well as various libraries and JavaScript bits 'n pieces that ought to come in handy.

So how's all this shape up against OpenSocial? The latter seems to have wider use, at least in terms of who's using the API, but Facebook has a brand recognition (yup, that again) that's tough to ignore. I suspect both OpenSocial and the FaceBook code will end up getting used -- maybe even both together on the same sites! -- but it will be most instructive when some developers actually step up and talk about their experiences with the code.

0 comments: