Programming Social Applications
Jonathan LeBlanc
Copyright 2011 Yahoo!, Inc.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (.
Nutshell Handbook, the Nutshell Handbook logo, and the OReilly logo are registered trademarks of OReilly Media, Inc. Programming Social Applications , the image of a Diana monkey and related trade dress are trademarks of OReilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and OReilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
O'Reilly Media
Preface
I first began developing social applications when Facebook opened up its developer platform in 2007, giving people like me a taste of the extensive social data that an application can use to improve growth and target personalization settings. At the time, I was building social fantasy sports applications for CBSSports.com, pulling user information to enrich that fantasy sports data into a highly personalized state.
It wasnt until 2008, when I joined the partner integrations team in the Yahoo! Developer Network, that I got my first peek at an open source approach to social application development through OpenSocial. What attracted me to OpenSocial was not the fact that you could build an application once and deploy to numerous OpenSocial containers (which proved to be a faulty notion), but rather that through an open source approach I could build social applications on a container and understand how these platforms worked from a core level. I developed a deep drive to explore how the relationships that people form on the Web can enrich and personalize their online lives. This was the starting point of my career advocating open source social technologies.
OpenSocial was the gateway specification for me, leading me to explore the Shindig OpenSocial container, OpenID and OAuth (for authentication and authorization, respectively ), the third-party code security technologies Caja and ADSafe, and newer distributed web framework specifications like Activity Streams, PubSubHubbub, and the Open Graph protocol. I quickly came to realize that there was a wide range of open source technologies to enable the construction of rich social frameworks. These technologies and specifications built rich layers of functionality in a simple way using very open methodologies.
These social technologies and specifications are what this book is about. Each chapter uncovers a new layer in the construction of highly viral social applications and platforms. We start by exploring the concepts behind social applications and containers, and then dive into the technologies used to build them. With the application basics down, we look at technologies to secure third-party code on a container, and follow with a discussion of how to secure user information and develop a standard login architecture for platforms. After exposing all of those complex layers, we take an in-depth look at distributed web frameworks that showcase standardization techniques for syndicating activities, discovering rich web and user data from sites and email addresses . And finally, we explore some wonderful upcoming standards in the social application world.
The content of this book comes from years of direct partner integration work emphasizing the power and features behind open source technologies while collaborating with other developers and companies to create rich social integrations with Yahoo!. This book is a labor of love, as I have both taught and learned from seeing firsthand how social integration technologies are applied to real-world applications and interactions.
Audience
Since this book touches on many different areas of social web application development, container specifications, architecture, and standards, the audience that it will appeal to includes a wide breadth of fields and proficiencies, including (but not limited to):
Social web application developers who are building applications for Facebook, iGoogle, Orkut, YAP, or any other social networking site that hosts third-party applications
Application platform architects and server-side engineers who are building products to host a socialized experience
Frontend engineers who wish to leverage the customization and direct targeting afforded by the massive social graph derived from these technologies
Hackers and part-time developers who are building small-scale personal projects off of the social web
Followers of open source technology who want to understand how these technologies are being used to promote social sharing and standards
Web developers and company teams who wish to develop membership systems and authentication security
Security gurus and engineers who want to learn about security within online social experiences
Contents of This Book
This book covers many technologies and tools for working with the social web, from container and application development to building highly engaging social graphs.
Each chapter builds on the fundamentals youve learned in the preceding chapters social explorations. Here are the overarching topics covered throughout the book, broken down by chapter:
Takes you through an overview of applications, systems, and open source fundamentals to give you a good foundation for implementing the technologies in the remainder of the book.
Explores the concepts behind the social graph, breaking it down into its fundamental properties.
This chapter forms the base of our social application development, walking you through the construction of a social container to host third-party applications.
Examines extensions and features built into the OpenSocial JavaScript libraries.
Chapters
These chapters offer a deeper exploration of the OpenSocial specification. We will look at the core social aspects of a social platform, from the social graph implementation to the data architecture model.
Our final OpenSocial chapter will dive into advanced OpenSocial topics such as templating, data pipelining methods, and the future of OpenSocial.
Covers third-party code security models and how a container can protect itself and its users against malicious code using frontend security systems.
Explores user and application authorization through OAuth, diving into both OAuth 1 and the newer OAuth 2 specification.
Details experimental and new technologies being developed for constructing social graphs, activities, and distributed web frameworks.
Chapters and 12 (Chapter 12 available online)
These final chapters look at user authentication and authentication security through the use of OpenID and the OpenID OAuth hybrid extension.
Chapter 12, the Glossary, and the Appendix are available on this books website.
Using an Open Source Technology Stack
Since this books major focus is teaching the fundamentals of social application, container, and graph development using an open source stack, it is only prudent that I outline the technologies we will examine.