75

Google IO 2008 - Opensocial, a Standard for the Social Web

  • View
    25.619

  • Download
    1

Embed Size (px)

DESCRIPTION

OpenSocial is an open specification defining a common API that works on many different social websites, including MySpace, Plaxo, Hi5, Ning, orkut, Salesforce.com and LinkedIn, among others. This allows developers to learn one API, then write a social application for any of those sites: Learn once, write anywhere. In addition, in order to make it easier for developers of social sites to implement the API and make their site an OpenSocial container, the Apache project Shindig provides reference implementations for OpenSocial containers in two languages (Java, PHP). Shindig will define a language specific Service Provider Interface (SPI) that a social site can implement to connect Shindig to People, Persistence and Activities backend services for the social site. Shindig will then expose these services as OpenSocial JavaScript and REST APIs. In this session we will explain what OpenSocial is, show examples of OpenSocial containers and applications, demonstrate how to create an OpenSocial application, and explain how to leverage Apache Shindig in order to implement an OpenSocial container.

Citation preview

Page 1: Google IO 2008 - Opensocial, a Standard for the Social Web
Page 2: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial: A Standard for the Social Web

Patrick ChanezonKevin MarksChristian Schalk

May 28, 2008

Page 3: Google IO 2008 - Opensocial, a Standard for the Social Web

Agenda

OpenSocial Introduction

How to build OpenSocial Applications

OpenSocial Containers

Becoming an OpenSocial container

Summary

Page 4: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial Introduction - Patrick Chanezon

Page 5: Google IO 2008 - Opensocial, a Standard for the Social Web

Making the web betterby making it social

What does social mean?

Page 6: Google IO 2008 - Opensocial, a Standard for the Social Web

What does Social mean?

Eliette what do you do with your friends?

Page 7: Google IO 2008 - Opensocial, a Standard for the Social Web

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 8: Google IO 2008 - Opensocial, a Standard for the Social Web

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 9: Google IO 2008 - Opensocial, a Standard for the Social Web

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 10: Google IO 2008 - Opensocial, a Standard for the Social Web

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 11: Google IO 2008 - Opensocial, a Standard for the Social Web

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 12: Google IO 2008 - Opensocial, a Standard for the Social Web

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 13: Google IO 2008 - Opensocial, a Standard for the Social Web

Raoul: a social object for Charlotte (3 year old)

Page 14: Google IO 2008 - Opensocial, a Standard for the Social Web
Page 15: Google IO 2008 - Opensocial, a Standard for the Social Web

Jaiku’s Jyri Engeström's 5 rules for social networks: social objects

1. What is your object?2. What are your verbs?3. How can people share the objects? 4. What is the gift in the invitation?5. Are you charging the publishers or the spectators?http://tinyurl.com/yus8gw

Page 16: Google IO 2008 - Opensocial, a Standard for the Social Web

How do we socialize objects online

without having to create yet another social network?

Page 17: Google IO 2008 - Opensocial, a Standard for the Social Web
Page 18: Google IO 2008 - Opensocial, a Standard for the Social Web
Page 19: Google IO 2008 - Opensocial, a Standard for the Social Web
Page 20: Google IO 2008 - Opensocial, a Standard for the Social Web
Page 21: Google IO 2008 - Opensocial, a Standard for the Social Web

Standards create markets: Hal Varian

OpenSocial is a straightforward application of chapters 8 and 9 of his 1998 book "Information Rules"“Standards change competition for a market to competition within a market”

Network EffectsLock-In and Switching CostsStandards

Page 22: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial

A common API for social applications across multiple web sites

Page 23: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial Foundation

OpenSocial Foundationhttp://opensocial.org/Keep the specification open

Specifications discussed in public forumSpec evolves using an open source community process

Page 24: Google IO 2008 - Opensocial, a Standard for the Social Web
Page 25: Google IO 2008 - Opensocial, a Standard for the Social Web

friendster®

OpenSocial Containers

Page 26: Google IO 2008 - Opensocial, a Standard for the Social Web

Standards-based

html+javascript+REST+oauth

Page 27: Google IO 2008 - Opensocial, a Standard for the Social Web

Why should you care about OpenSocial?

Developers: Distribution >275 Million users

Containers: Features

Users: More applications

Page 28: Google IO 2008 - Opensocial, a Standard for the Social Web

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 29: Google IO 2008 - Opensocial, a Standard for the Social Web

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 30: Google IO 2008 - Opensocial, a Standard for the Social Web

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 31: Google IO 2008 - Opensocial, a Standard for the Social Web

A standard for everyone

This work by Eliette Chanezon is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Page 32: Google IO 2008 - Opensocial, a Standard for the Social Web

How To Build OpenSocial Applications - Chris Schalk

Page 33: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial Client API

JavaScript - version 0.7 productionStandard Web development technologies

HTML + JavascriptCan integrate with 3rd party server

REST ServicesBased on Atom publishing protocolAtomPub and JSON

Page 34: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial JavaScript API

People & Friends Access friends information programmatically

ActivitiesSee what you’re friends are up toShare what you are doing

PersistenceProvide state without a serverShare data with your friends

The core OpenSocial Services include

Page 35: Google IO 2008 - Opensocial, a Standard for the Social Web

People & Friends ExampleRequesting friend Info

function getFriendData() { var req = opensocial.newDataRequest(); req.add(req.newFetchPersonRequest(VIEWER), 'viewer'); req.add(req.newFetchPeopleRequest(VIEWER_FRIENDS), 'viewerFriends'); req.send(onLoadFriends);}

Page 36: Google IO 2008 - Opensocial, a Standard for the Social Web

People & Friends Example

function onLoadFriends(resp) { var viewer = resp.get('viewer').getData(); var viewerFriends = resp.get('viewerFriends').getData(); var html = 'Friends of ' + viewer.getDisplayName() + ‘:<br><ul>’; viewerFriends.each(function(person) { html += '<li>' + person.getDisplayName()+'</li>';}); html += '</ul>'; document.getElementById('friends').innerHTML = html;}

Callback function for returned friend data

Page 37: Google IO 2008 - Opensocial, a Standard for the Social Web

Activities Example

function postActivity(text) { var params = {}; params[opensocial.Activity.Field.TITLE] = text; var activity = opensocial.newActivity(params); opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH, callback);}postActivity("This is a sample activity, created at " + new Date().toString())}

Posting an activity

Page 38: Google IO 2008 - Opensocial, a Standard for the Social Web

Persistence Example

function populateMyAppData() { var req = opensocial.newDataRequest(); var data1 = Math.random() * 5; var data2 = Math.random() * 100;

req.add(req.newUpdatePersonAppDataRequest("VIEWER", "AppField1", data1)); req.add(req.newUpdatePersonAppDataRequest("VIEWER", "AppField2", data2)); req.send(requestMyData);}

Persisting data

Page 39: Google IO 2008 - Opensocial, a Standard for the Social Web

Persistence Example

function requestMyData() { var req = opensocial.newDataRequest(); var fields = ["AppField1", "AppField2"];

req.add(req.newFetchPersonRequest( opensocial.DataRequest.PersonId.VIEWER), "viewer"); req.add(req.newFetchPersonAppDataRequest("VIEWER", fields), "viewer_data"); req.send(handleReturnedData);}

Fetching persisted data

Page 40: Google IO 2008 - Opensocial, a Standard for the Social Web

Persistence Example

function handleReturnedData(data) { var mydata = data.get("viewer_data"); var viewer = data.get("viewer"); me = viewer.getData(); // me is global var var data = mydata[me.getId()];

htmlout += "AppField1: " + data["AppField1"] + "<br/>"; htmlout += "AppField2: " + data["AppField2"] + "<br/>"; var div = document.getElementById('content_div'); div.innerHTML = htmlout;}

Displaying fetched (persisted) data

Page 41: Google IO 2008 - Opensocial, a Standard for the Social Web

Demonstration - Building OpenSocial Applications using the JavaScript API

Page 42: Google IO 2008 - Opensocial, a Standard for the Social Web

Server-side REST Services

/people/{guid}/@all -- Collection of all people connected to user {guid}

/people/{guid}/@friends -- Collection of all friends of user {guid} -- subset of @all

/people/{guid}/@self -- Profile record for user {guid}

/people/@me/@self -- Profile record for requestor

Accessing People information

Page 43: Google IO 2008 - Opensocial, a Standard for the Social Web

Server-side REST Services

/activities/{guid}/@self -- Collection of activities generated by given user

/activities/{guid}/@friends -- Collection of activities for friends of the given user {guid}

Accessing Activities information

Page 44: Google IO 2008 - Opensocial, a Standard for the Social Web

Server-side REST Services

/appdata/{guid}/@self/{appid} -- All data for user {guid}, app {appid}

/appdata/{guid}/@friends/{appid} -- All data for friends of user {guid} and app {appid}; read-only

Accessing Persistent data

Page 45: Google IO 2008 - Opensocial, a Standard for the Social Web

Server-side REST Services

format={format} -- Format desired; one of (atom, json); default is json fields={field+} -- List of fields to include in request

startPage={startPage} -- Index into a paged collection

count={count} -- Set page size for paged collection

Additional query parameters

Page 46: Google IO 2008 - Opensocial, a Standard for the Social Web

Demonstration - Using the OpenSocial REST Services

Page 47: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial ServerSide Integration Options

Establish a "home" site where gadget can phone home to retrieve, post data

Can host home site on your own, or use services:Amazon EC2JoyentGoogle AppEngine

In addition to using the provided persistence API...

Page 48: Google IO 2008 - Opensocial, a Standard for the Social Web

Google AppEngine and OpenSocial

Create an App Engine app as your backend!Use makeRequest() to call back to your AppEngine serverUtilize AppEngine's datastore

New OpenSocial Apps are coming onlineBuddyPoke...

Checkout Lane Liabraaten’s OpenSocial-AppEngine integration article

http://code.google.com/apis/opensocial/articles/appengine.html

Google IO Code Lab about OpenSocial Apps in the Cloud

Page 49: Google IO 2008 - Opensocial, a Standard for the Social Web

Resources For Application DevelopersSpecificationhttp://opensocial.org/http://groups.google.com/group/opensocial-and-gadgets-spec

Code Samples and Toolshttp://code.google.com/opensocialhttp://code.google.com/p/opensocial-resources/

Sandboxeshttp://developer.myspace.com/http://www.hi5networks.com/developer/http://opensocial.ning.com/http://code.google.com/apis/orkut/http://code.google.com/apis/igoogle/http://en.netlog.com/go/developer/opensocial

Page 50: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial Containers - Kevin Marks

Page 51: Google IO 2008 - Opensocial, a Standard for the Social Web

Containers provide a social context

OpenSocial separates application logic from social contextan app sees user ids - the container makes them peopleUsers understand the social contract of the containersSave apps and users from re-registration hell

Page 52: Google IO 2008 - Opensocial, a Standard for the Social Web

Containers don’t choose users

Containers set up the social model, users choose to jointhey grow through homophily and affinityNetwork effect can bring unexpected userbases

Page 53: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial gets you to all their users

You don't have to pick a site to specialise forYou get to spread through multiple friend groupsYou'll be surprised by where your users areso make sure you plan to localize

Page 54: Google IO 2008 - Opensocial, a Standard for the Social Web

Not just Social Network Sites

Social network sites - Profiles and home pagesPersonal dashboardsSites based around a Social ObjectCorporate CRM systemsAny web site

How do we abstract these out?

Viewer + friendsOwner + friends

Page 55: Google IO 2008 - Opensocial, a Standard for the Social Web

The Viewer and Viewer friends

Page 56: Google IO 2008 - Opensocial, a Standard for the Social Web

Owner and Owner friends

Page 57: Google IO 2008 - Opensocial, a Standard for the Social Web

Owner and Viewerare defined by Container

The Application gets IDs and connections to other IDs

Page 58: Google IO 2008 - Opensocial, a Standard for the Social Web

the Owner need not be a PersonIt could be an organisation

or a social object

Page 59: Google IO 2008 - Opensocial, a Standard for the Social Web

Kinds of container - Social network sites

Profile pagesOwner is profile page ownerViewer may not be known, may be owner or other member

Home pagesOwner is Viewer (must be logged in to see)

ExamplesMySpaceHi5Orkut

Page 60: Google IO 2008 - Opensocial, a Standard for the Social Web

Kinds of container - Personal dashboard

like Home pagesOwner is Viewer (must be logged in to see)

Friends may not be definedExample:

iGoogle, My Yahoo

Page 61: Google IO 2008 - Opensocial, a Standard for the Social Web

Kinds of container - Social Object site

Pages reflect the object - movie, picture, productOwner is the objectOwner friends are people connected to the object

may be authors or fansViewer is looking at it, Viewer friends are people you may want to share with

Example:Imeem is a bit like this - opportunity for sites like Flickr, YouTube

Page 62: Google IO 2008 - Opensocial, a Standard for the Social Web

Kinds of container - CRM systems

Pages reflect the customer Owner is the customerOwner friends are people connected to the customer

may be your colleagues, or other customersViewer is you, Viewer friends are your colleagues or customers

Example:Oracle CRM, Salesforce

Page 63: Google IO 2008 - Opensocial, a Standard for the Social Web

Kinds of container - Any web site

Owner is the site

Owner friends are site usersViewer is you,

Viewer friends are your friends who have visited this siteExample:

Google Friend Connect will enable this for any site

Page 64: Google IO 2008 - Opensocial, a Standard for the Social Web

Container Sites control policy

Check the EnvironmentGetting information

Viewer information may not be availableor it may be hidden from youCall requestPermission API that can prompt the users

Spreading your applicationActivities display under container controlRequestSendMessageRequestShareApp

Monetization and Installation

Meet the Containers (next session)Best Practices for Spreading your App (tomorrow)

Page 65: Google IO 2008 - Opensocial, a Standard for the Social Web

Netlog demo

Page 66: Google IO 2008 - Opensocial, a Standard for the Social Web

Becoming an Open Social Container - Chris Schalk

Page 67: Google IO 2008 - Opensocial, a Standard for the Social Web

Becoming an OpenSocial Container

Question: How do you become an OpenSocial container?

Answer: Utilize existing Open Source container code.

The Apache incubator project “Shindig” serves this purpose!

Page 68: Google IO 2008 - Opensocial, a Standard for the Social Web

Apache Shindig

What is Shindig?Open source software that allows you to host OpenSocial applications

Is currently an Apache Software Incubator project Heavy partner involvement (Ning, hi5 …) Serves as open source reference implementation of OpenSocial & gadgets technologies

It’s Goal: “Shindig's goal is to allow new sites to start hosting social apps in well under an hour's worth of work"

Page 69: Google IO 2008 - Opensocial, a Standard for the Social Web

Apache Shindig Info...Apache Shindig Website

http://incubator.apache.org/shindig

Page 70: Google IO 2008 - Opensocial, a Standard for the Social Web

Demonstration - Implementing your own container using Shindig

Page 71: Google IO 2008 - Opensocial, a Standard for the Social Web

SocialSiteSocialSite is an Open Source project that allows you to turn your web application in an OpenSocial containerLeverages Apache ShindigBuilt by Sun (Dave "Roller" Johnson), announced at JavaOne this monthAdds a database and widgets to manage your social network

Page 72: Google IO 2008 - Opensocial, a Standard for the Social Web

SocialSite Architecture

Details at https://socialsite.dev.java.net/

Page 73: Google IO 2008 - Opensocial, a Standard for the Social Web

SummaryOpenSocial is making the web more socialThe current version 0.7 is in production

REST API and 0.8 coming soon

Developers can start creating social applications todayOrkut, Myspace, hi5, Netlog open to 200 M users nowiGoogle, IDTail, Hyves, Imeem sandboxes

Social sites: implement OpenSocial get Shindig and start planningSocialSiteFriend Connect

Advertisers: create brand advertising Apps now

Page 74: Google IO 2008 - Opensocial, a Standard for the Social Web

OpenSocial Sessions at Google I/O12 sessions

Building an OpenSocial Application, Focus on Client Side APIsApache Shindig: Make Your Social Site an OpenSocial ContainerOpenSocial - Scaling and Analytics, Nuts & BoltsURLs Are People Too - Using the Social Graph API to Build a Social WebFireside Chat: OpenSocialOpenSocial at MySpace: Creating popular apps on MySpaceOpenSocial across ContainersOpenSocial Specification: What's Next for OpenSocialMonetizing Application Traffic On Social NetworkOpenSocial, OpenID, and OAuth: Oh, My!Best Practices for Spreading Your App without Ruining the User ExperienceBuilding on the Promise of OpenSocial

2 code labsMake Your Social Site an OpenSocial Container Using ShindigBuilding an OpenSocial Application in the Cloud

Page 75: Google IO 2008 - Opensocial, a Standard for the Social Web

Q & A