Building OpenSocial Apps

A Field Guide to Working With the MySpace Platform
An In-Depth Look at Google’s OpenSocial Specification.
OpenSocial was first released in November 2007, initially running only on Google’s own Orkut social network. OpenSocial is a set of APIs that let applications access data and functions on social networking sites that implement the specification. If you think this sounds a bit like the FaceBook Platform, it is that- however, one that is not controlled by one single company. At the same time, Google created the specification based on its Gadgets framework. It now exists as an open specification administered by the OpenSocial Foundation. Today several social networking sites besides Orkut support it ranging from social networks like Friendster and Hi5 to business networking LinkedIn. Still, probably the best known is MySpace which was one of the first to adopt it in 2007.

Being first to support a developing specification often means that inconsistencies will crop-up between the implementation and the official specification. Since the authors have been involved with OpenSocial since the beginning, they provide numerous stories about how the specification developed, and how it’s roots led to certain design decisions. At the time of writing, the specification is 0.9 as well, the book is specifically about creating applications that run on MySpace, so there are several quirks between the official specification and MySpace’s implementation. While these don’t seem to be significant, they need to be observed, and the writers do a good job of explaining the quirks and how to handle them. With that in mind, Building OpenSocial Apps takes readers right from the first MySpace “Hello World” into full applications.

See also  Drupal User's Guide

The book starts with creating the traditional “Hello World” application before moving into more advanced topics. Fundamentally the book is broken down into three sections: building an application on MySpace’s servers, creating apps that run off other servers (necessary for more extensive applications) and dealing with growth and security. Throughout the book, the readers work with a simple Tic-Tac-Toe game (is there any other kind?) that can be downloaded and is used as a starting point for learning about the MySpace Developer Platform and OpenSocial.

This book is not aimed at beginners. While the programming is done with JavaScript/HTML and Python, there’s no attempt made to teach either language. Besides the languages, readers should be familiar with web programming in general; while terms like REST are explained, your pretty-much expected to know how to use it already. One nice surprising find in the book was its use of Google’s App Engine for server-side programming. Again, this isn’t a book about writing for the App Engine (readers might want to pick up Apress’ Developing With Google App Engine), but you learn enough of the fundamentals to get going. App Engine is one of several cloud computing services that are useful as your application grows, so it makes sense to employ it here.

Overall, this is a good hands-on book on how to write social web applications that run on the MySpace Developer Platform. While it’s not a tutorial for beginners to web programming, it does enough “hand-holding” to guide programmers already familiar with JavaScript, XML, REST and Python through creating a fairly complete application that can be installed by MySpace users. What’s more, while the book is MySpace-specific where it has to be, there’s a lot of practical OpenSocial advice that will be useful as the platform matures and grows in popularity.

See also  Drupal 6 Themes