Wrox.Opensocial.Network.Programming.Apr.2009.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
spine=.816" Programmer to Programmer™ Get more out of WROX.com Interact Chapters on Demand Take an active role online by participating in Purchase individual book chapters in pdf our P2P forums format Wrox Online Library Join the Community Hundreds of our books are available online Sign up for our free monthly newsletter at through Books24x7.com newsletter.wrox.com Wrox Blox Browse Download short informational pieces and Ready for more Wrox? We have books and code to keep you up to date and out of e-books available on .NET, SQL Server, Java, trouble! XML, Visual Basic, C#/ C++, and much more! Contact Us. We always like to get feedback from our readers. Have a book idea? Need community support? Let us know by e-mailing [email protected] Grewe ffirs.tex V2 - 03/09/2009 5:15pm Page i OpenSocial Network Programming Introduction ......................................................................xvii Chapter 1: Social Network Programming ...............................................1 Chapter 2: Introduction to OpenSocial ............................................... 55 Chapter 3: Gadget XML and Gadget API .............................................. 87 Chapter 4: JavaScript API ......................................................... 111 Chapter 5: OpenSocial RESTful API ................................................. 169 Chapter 6: Programming Fundamentals ............................................. 221 Chapter 7: Sample Applications .................................................... 235 Chapter 8: Performance, Scalability, and Monetization ............................... 277 Chapter 9: OpenSocial Templates, Markup, and Emerging Technologies ................ 325 Index ........................................................................... 375 Grewe ffirs.tex V2 - 03/09/2009 5:15pm Page ii Grewe ffirs.tex V2 - 03/09/2009 5:15pm Page iii OpenSocial Network Programming Lynne Grewe Wiley Publishing, Inc. Grewe ffirs.tex V2 - 03/09/2009 5:15pm Page iv OpenSocial Network Programming Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright 2009 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-0-470-44222-7 Manufactured in the United States of America 10987654321 Library of Congress Cataloging-in-Publication Data: Grewe, Lynne, 1965- OpenSocial network programming / Lynne Grewe. p. cm. Includes index. ISBN 978-0-470-44222-7 (paper/website) 1. Online social networks — Computer software. 2. Online social networks — Design. 3. Application program interfaces (Computer software) I. Title. HM742.G74 2009 006.7’54 — dc22 2009001915 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ, 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. OpenSocial is a trademark of Google, Inc. All other trademarks are the property of their respective owners. Wiley Publishing, Inc. is not associated with any product or vendor mentioned in this book. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Grewe ffirs.tex V2 - 03/09/2009 5:15pm Page v To my family, Ben, Allen, and Jake, thank you for sharing this life and love with me. To my best friend and mother, Joyce, thank you for all of your love and support. To my father, Larry, and brother, Jeff, thanks for believing in me. Grewe f01.tex V1 - 03/09/2009 5:16pm Page vi About the Author Lynne Grewe, Ph.D., is founder and director of ILab at California State University East Bay, where she as a professor in Computer Science. She created the first class in a university to teach social network programming, using the platforms of OpenSocial, Facebook, and others. Previously, she worked at IBM as a media specialist. She received her Ph.D. in Electrical and Computer Engineering from Purdue. She has collaborated with numerous companies in social networking. She has published in professional journals and presented at many conferences and symposiums. Lynne has contacts in industry that are spearheading social network platforms and including Sun, Yahoo!, and Google. She is also a leader in the community developing personalization/socialization of the social network experience and is a member of the OpenSocial foundation. Grewe f02.tex V1 - 03/09/2009 5:16pm Page vii Credits Executive Editor Vice President and Executive Group Publisher Carol Long Richard Swadley Development Editor Vice President and Executive Publisher Kevin Shafer Barry Pruett Technical Editor Ken Walton Associate Publisher Jim Minatel Production Editor Liz Britten Project Coordinator, Cover Lynsey Stamford Copy Editor Kim Cofer Foxxe Editorial Services Proofreader Josh Chase (Word One) Editorial Manager Mary Beth Wakefield Indexer J&JIndexing Production Manager Tim Tate Grewe f03.tex V1 - 03/09/2009 5:17pm Page viii Acknowledgments I would like to thank a number of people for helping me create the best book possible. Thank you to Kevin Shafer, my development editor at Wiley, who with his considerable experience made this book shine. Thank you to Carol Long, executive acquisitions editor at Wiley, a great editor who guided me through the process. Also, thanks to the Wiley publishing team, including Sara Shlaer and Kirk Bateman. A special thanks to Ken Walton, director of business development and chief software architect at Klick- Nation, who served as technical editor and spent many hours reviewing the book, making suggestions, and helping to ensure that there are no errors. I also interviewed a number of people to create this book and want to thank the following for their invaluable assistance: T Ken Walton, director of business development and chief software architect, KlickNation T Cody Simms, Yahoo!, senior director, Yahoo! platforms T Prakash Narayan, Zembly T Jia Shen, CTO and founder, RockYou T Lan LiaBraaten, Sara Jew-lim, Jan Penner, Google T David Young, Slide T Paul Linder, platform architect, hi5 T Rod Boothby, vice president, Joyent T Ali Partovi, CEO, iLike T Vikas Gupta, cofounder/CEO, Jambool T Charlene Li, emerging technologies and coauthor of ‘‘Groundswell’’ T Kevin Chou, CEO, Watercooler T Rhett Mcnulty, COO, Shopit T Stefano Pochet, Nealab Technologies, Freebar T Jeff Roberto, Friendster T Gina Olsen, imeem T Pieter De Schepper, Netlog Grewe ftoc.tex V1 - 03/09/2009 5:17pm Page ix Contents Introduction xvii Chapter 1: Social Network Programming 1 Social Network Platforms 2 MySpace 2 hi5 5 orkut 7 Friendster 8 imeem 9 Freebar 9 Netlog 11 Yahoo! 12 Other Networks 14 Social Network Applications 14 Application Discovery 15 Application Installation 16 Application Appearance 17 Control of Applications 25 Making Applications Social and Viral 29 Application Goals 29 Growth 30 Engagement 30 Good Look and Feel 32 Dynamic Evolution 32 Self Expression 32 Social Exposure 33 Relationship Building 33 Real-World Problem Solving 33 Application Trends 33 Reach (General Appeal) Applications 35 Vertical (Targeted) Applications 36 Template-Based Application Development 36 Brand Applications 39 Destination Applications 39 Grewe ftoc.tex V1 - 03/09/2009 5:17pm Page x Contents Longer Engagement 39 Use of Media