Jaoo - Open Social A Standard For The Social Web

106
OpenSocial a standard for the social web Patrick Chanezon [email protected] 9 september 2008
  • date post

    13-Sep-2014
  • Category

    Business

  • view

    12.841
  • download

    1

description

see http://jaoo.dk/presentation/OpenSocial%2C+a+Standard+for+the+Social+WebOpenSocial is a standard for the social web managed by the OpenSocial foundation. Introduced by 18 social sites in november 2007, after 8 months OpenSocial is available to 275 million users, 2000 applications have been developed and 10 million users are using them daily.The session will start with a status of OpenSocial after a year: the ecosystem that formed around the API: social sites, developers, advertisers, tool vendors, IT consulting firms, enterprise software vendors.For developers of social application, the OpenSocial API JavaScript and REST APIs will be described, with demos of how to build a social application using each API.For developers of social sites, or sites that want to become OpenSocial containers, the OpenSocial reference implementation is developed as an open source project, Apache Shindig, with a Java and PHP flavors. The stated goal of Shindig is to enable a social site developer to implement OpenSocial support on her site in 2 weeks. The Shindig Java architecture will be explained, followed by a demo of how to connect Shindig to a MySql backend.Various related projects will also be demoed:- Friend Connect, a Google offering enabling web sites to add social capabilities with a few lines of javascript.- Socialsite, a Sun open source project based on Shindig, enabling web sites to become social sites with their own community, using gadgets to provide a user interface to manage the network.- OpenSocket, a hosted service that allows OpenSocial applications to be deployed on Facebook.

Transcript of Jaoo - Open Social A Standard For The Social Web

Page 1: Jaoo - Open Social A Standard For The Social Web

OpenSociala standard for the social web

Patrick [email protected]

9 september 2008

Page 2: Jaoo - Open Social A Standard For The Social Web

Agenda

OpenSocial introductionHow to build OpenSocial applicationsHosting social applicationsSocial applications monetization OpenSocial containers Becoming an OpenSocial containerGoogle Friend ConnectSummary

Page 3: Jaoo - Open Social A Standard For The Social Web

OpenSocial IntroductionPatrick Chanezon

Page 4: Jaoo - Open Social A Standard For The Social Web

Making the web betterby making it social

What does social mean?

Page 5: Jaoo - Open Social A Standard For The Social Web

What does Social mean?

Eliette what do you do with your friends?

Page 6: Jaoo - Open Social A Standard For The Social Web

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

Page 7: Jaoo - Open Social 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: Jaoo - Open Social 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: Jaoo - Open Social 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: Jaoo - Open Social 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: Jaoo - Open Social 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: Jaoo - Open Social A Standard For The Social Web

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

Page 13: Jaoo - Open Social A Standard For The Social Web
Page 14: Jaoo - Open Social 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 15: Jaoo - Open Social A Standard For The Social Web

How do we socialize objects online

without having to create yet another social network?

Page 16: Jaoo - Open Social A Standard For The Social Web

OpenSocial

A common API for social applications across multiple web sites

Page 17: Jaoo - Open Social A Standard For The Social Web

The Trouble with Developing Social Apps

Which site do I build my app for?

Page 18: Jaoo - Open Social A Standard For The Social Web

Let’s work on that…

Using OpenSocial, I can build apps for all of these sites!

Page 19: Jaoo - Open Social A Standard For The Social Web

What’s offered by OpenSocial?

ActivitiesWhat are people up to on the web

People/Profile InfoWho do I know, etc.

Persistent datastoreHandles key/value pairs

Page 20: Jaoo - Open Social A Standard For The Social Web

Today: 375 Million User Reach

Page 21: Jaoo - Open Social A Standard For The Social Web

Where is OpenSocial live today?

Live to Users:MySpaceorkutHi5FreebarFriendsterWebon from LycosIDtailYiQiNetlog - New!Hyves - New!

Live Developer Sandboxes:iGoogleimeemCityINTianyaNingPlaxo PulseMail.ru

Individual Developer Links: http://code.google.com/apis/opensocial/gettingstared.html

Page 22: Jaoo - Open Social A Standard For The Social Web

OpenSocial “Containers”

Page 23: Jaoo - Open Social A Standard For The Social Web

What’s in OpenSocial?

JavaScript API - Now

REST Protocol - New

Templates - Prototype in Shindig

Page 24: Jaoo - Open Social A Standard For The Social Web

OpenSocial’s JavaScript API

OpenSocial JS APIGadget JS APIGadget XML schema

OpenSocial v0.7 is liveOpenSocial v0.8 is being deployed now

Specs and release notes: http://opensocial.org

Page 25: Jaoo - Open Social A Standard For The Social Web

OpenSocial’s REST Protocol

Access social data without JavaScriptWorks on 3rd party websites / phones / etcUses OAuth to allow secure accessOpen source client libraries in development

Java, PHP, Python, <your fav language here>

Being deployed with OpenSocial v0.8

Spec’s available at http://opensocial.org

Page 26: Jaoo - Open Social A Standard For The Social Web

OpenSocial Templates

Writing JavaScript is hardWriting templates is easyTemplates also give

Consistent UI across containersEasy way to localizeMore interesting content options when inlining into container (activities, profile views)Ability to serve millions of dynamic pages per day without a server

Page 27: Jaoo - Open Social A Standard For The Social Web

Design principles

Create a template language that is:

SimpleEasy markup for creating UI and binding data

Fast

Supports server-side optimizations

ExtensibleStandard reusable controls (buttons, lists, links, etc.)

Everywhere

Only need to include a single JavaScript file

Page 28: Jaoo - Open Social A Standard For The Social Web

Concepts:

MarkupA set of standard tags and behaviors that provide developers with a simple, declarative language for assembling apps.

Templating

A set of standard elements implemented by containers. A method for taking structured data and rendering UI elements in an arbitrary markup.

Data Pipelining

A method for grabbing OpenSocial and third-party data declaratively (or in script) and joining it to templates.

Page 29: Jaoo - Open Social A Standard For The Social Web

Example: os:Image

<os:Image key="http://..."/>

Page 30: Jaoo - Open Social A Standard For The Social Web

Example: osTabs, os:ShowPerson

<os:Tabs name="tabGroup"> <tab> <title>Tab 1</title> <body>This is the first tab.</body> </tab> ...

<tab> <title>Tab 3</title> <body> <os:ShowPerson person="${Viewer}"/> <div repeat="ViewerFriends"> <os:ShowPerson person="${$this}"/> </div> </body> </tab></os:Tabs>

Page 31: Jaoo - Open Social A Standard For The Social Web

Example: Friends list (no templates)

Page 32: Jaoo - Open Social A Standard For The Social Web

Example: Friends list (with templates)

Page 33: Jaoo - Open Social A Standard For The Social Web

Template Status

High-level specification complete:http://wiki.opensocial-templates.org

Prototype implementation available:

http://ostemplates-demo.appspot.com

GET INVOLVED! Tag feedback/suggestions appreciated:http://tech.groups.yahoo.com/group/os-templates/

Code for templates is in Shindig: patches welcome:-)

Page 34: Jaoo - Open Social A Standard For The Social Web

OpenSocial is what you make it.

OpenSocial is an open source project.The spec is controlled by the community.Anyone can contribute and have a voice.http://groups.google.com/group/opensocial/

“OpenSocial and Gadgets spec” subgroup

OpenSocial FoundationGet involved to nominate and elect board repshttp://www.opensocial.org/opensocial-foundation/

Page 35: Jaoo - Open Social A Standard For The Social Web

A note on compliance

OpenSocial is designed for many sites

Building an app:TechnologyPolicy

OpenSocial Compliance Tests http://code.google.com/p/opensocial-resources/wiki/ComplianceTests

Page 36: Jaoo - Open Social A Standard For The Social Web

OpenSocial Compliance test in orkut

Page 37: Jaoo - Open Social A Standard For The Social Web

OpenSocial Compliance Matrix

http://opensocial-compliance.appspot.com

Page 38: Jaoo - Open Social A Standard For The Social Web

Other comments

Portable Contacts Alignment

Caja for JavaScript security

Page 39: Jaoo - Open Social 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 40: Jaoo - Open Social A Standard For The Social Web

How To Build OpenSocial Applications

Page 41: Jaoo - Open Social A Standard For The Social Web

Owner and Viewer Relationship

Owner

Applicationshas views

Viewer

has

Friends

has

Friends

Page 42: Jaoo - Open Social A Standard For The Social Web

Understanding the Gadget XML<?xml version="1.0" encoding="UTF-8" ?><Module> <ModulePrefs title="Hello World!"> <Require feature="opensocial-0.7" /> </ModulePrefs> <Content type="html"> <![CDATA[ <script> function init(){ alert("hello world"); } gadgets.util.registerOnLoadHandler(init);</script> ]]> </Content></Module>

ModulePrefs define characteristics of the gadget, such as title,

author, etc.

Require nodes should be added for all desired features

Module node defines the gadget.

Define your gadget html within Content

node

Page 43: Jaoo - Open Social A Standard For The Social Web

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

function onLoadFriends(response) { var viewer = response.get('viewer').getData(); var viewerFriends = response.get('viewerFriends').getData(); ///More code}

Create a new data request object and

add the desired sub-requests.

Place an asynchronous call to

the container.

Handle the returned data in callback

Page 44: Jaoo - Open Social A Standard For The Social Web

Persisting Datafunction 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);}

Use a newUpdatePersonAppDa

taRequest() to update data.

Page 45: Jaoo - Open Social A Standard For The Social Web

Fetching persisted datafunction 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);}

function handleReturnedData(data) {var mydata = data.get("viewer_data");var viewer = data.get("viewer");me = viewer.getData(); var appField1 = mydata[me.getId()]["AppField1"]; ///More code}

Use a newFetchPersonAppDataRequest() to fetch

data.

AppData is returned as a 2-level Map, with person

id as the first key and propertyname as the

next key

Page 46: Jaoo - Open Social A Standard For The Social Web

Posting an Activityfunction 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())

requestCreateActivity is a request, a specific

container may choose to ignore it.

Page 47: Jaoo - Open Social 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 48: Jaoo - Open Social A Standard For The Social Web

Hosting social apps Patrick Chanezon

Page 49: Jaoo - Open Social A Standard For The Social Web

Hosting OpenSocial apps

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

Zembly: is the world's first cloud-based development environment for social apps. Full OpenSocial support

In addition to using the provided persistence API...

Page 50: Jaoo - Open Social 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 51: Jaoo - Open Social A Standard For The Social Web

Social Apps monetization Patrick Chanezon

Page 52: Jaoo - Open Social A Standard For The Social Web

OpenSocial MonetizationAds from Ad Networks

AdSense, RightMediaBuddyPoke, Rate My Friend

Brand/Private Label App Sony Ericsson MTV Roadies app on orkut

Sell virtual or real goodsFree -> FreemiumReferralsVirtual currency

Page 53: Jaoo - Open Social A Standard For The Social Web

Success Story: Buddy Poke

#1 OpenSocial app on orkut8M installs for orkut, hi5, MySpace$1-2 CPM#1 App for App Engine w/ millions daily PV

Page 54: Jaoo - Open Social A Standard For The Social Web

Success Story: PhotoBuzz

6M+ installs on hi5 and orkutCPM $1-3, especially good on orkut4M buzzes per daySmall team of 4 people, profitable

Page 55: Jaoo - Open Social A Standard For The Social Web

Container specifics

Page 56: Jaoo - Open Social A Standard For The Social Web

Container Specific ExtensionsMySpace

photo albumsvideos

hi5

statuspresencephoto albums

Netlog

credits api extensiontranslation tool for free

Imeemmusic metadata api

Page 57: Jaoo - Open Social A Standard For The Social Web

Your Profile

Page 58: Jaoo - Open Social A Standard For The Social Web

Seemless translation

Page 59: Jaoo - Open Social A Standard For The Social Web

Localisation is important!

Translations are automatically injected

Translation tool for Netlog translators

Page 60: Jaoo - Open Social A Standard For The Social Web

Monetization

Page 61: Jaoo - Open Social A Standard For The Social Web

What’s in it for you?

Branding, co-branding, sponsorships

100% revenue from vertical rectangle or skyscraper on your application page

Credit economy with Netlog OpenSocial extension

Page 62: Jaoo - Open Social A Standard For The Social Web

Credit Economy

Virtual CurrencyUse Cases

charge credits for app installationcharge credits for certain featurescharge credits for buying itemscharge credits for...

Page 63: Jaoo - Open Social A Standard For The Social Web

Questions?

Developer pages:http://es.netlog.com/go/developer/

OpenSocial sandbox:http://es.netlog.com/go/developer/opensocial/sandbox=1

Page 64: Jaoo - Open Social A Standard For The Social Web

ViadeoAriel Messias

Page 65: Jaoo - Open Social A Standard For The Social Web

Social NetworkBusiness ToolCareer Management

© viadeo – septembre 2008

Page 66: Jaoo - Open Social A Standard For The Social Web

Benefits Viadeo can offer to developers

8 languages (European + China)

Professional oriented

Distribution of Members among all the Industries

Mainly “A Level” profiles

Members with High Revenues => Strong capabilities of monetization

Page 67: Jaoo - Open Social A Standard For The Social Web

Vertical Apps ?

Members split by industry

Page 68: Jaoo - Open Social A Standard For The Social Web

“A Level” priority targets ?

High qualification of Viadeo’s members

Page 69: Jaoo - Open Social A Standard For The Social Web

Apps for Professional Social Network…

Helping to :

Find Customers / Partners / Suppliers

Organize Meetings/Events

Share information and expertise

But also ...

Get headhunted…

…and recruit

Etc…

Page 70: Jaoo - Open Social A Standard For The Social Web

Sandbox Presentation – Create a Dev. Account

Page 71: Jaoo - Open Social A Standard For The Social Web

Becoming an OpenSocial Container

Page 72: Jaoo - Open Social A Standard For The Social Web

Becoming an OpenSocial Container

Question: How do you become an OpenSocial container?

Answer: The Apache incubator project “Shindig” serves this purpose!

Page 73: Jaoo - Open Social A Standard For The Social Web

What is Shindig ?

Open source reference implementation of OpenSocial & Gadgets specificationAn Apache Software Incubator projectAvailable in Java & PHP http://incubator.apache.org/shindig

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

Page 74: Jaoo - Open Social A Standard For The Social Web

Introduction to Shindig ArchitectureGadget ServerSocial Data Server Gadget Container JavaScript

Page 75: Jaoo - Open Social A Standard For The Social Web

Gadget Server

Page 76: Jaoo - Open Social A Standard For The Social Web

Social Server

Page 77: Jaoo - Open Social A Standard For The Social Web

Social Server - RESTful APIPreview available on

iGoogleOrkutHi5

New development modelsServer to server & Mobile!

Try it out:curl http://localhost:8080/social/rest/people/john.doe/@all

Page 78: Jaoo - Open Social A Standard For The Social Web

Shindig Server Side (Java) Architecture

Page 79: Jaoo - Open Social A Standard For The Social Web

Shindig Client Side Libraries

Page 80: Jaoo - Open Social A Standard For The Social Web

Opensocial – JS Library

Page 81: Jaoo - Open Social A Standard For The Social Web

Implementing Shindig - Data sourcesIntegrate with your own data sources

People ServiceActivities ServiceApp Data Service

class MyPeopleService implements PeopleService {...}

class MyAppDataService implements AppDataService {...}

class MyActivitiesService implements ActivitiesService {... }

Page 82: Jaoo - Open Social A Standard For The Social Web

Implementing Shindig - PHPImplement functions

function getActivities($ids) { $activities = array(); $res = mysqli_query($this->db, ”SELECT…"); while ($row = @mysqli_fetch_array($res, MYSQLI_ASSOC)) { $activity = new Activity($row['activityId'], $row['personId']); $activity->setStreamTitle($row['activityStream']); $activity->setTitle($row['activityTitle']); $activity->setBody($row['activityBody']); $activity->setPostedTime($row['created']); $activities[] = $activity; } return $activities;}

Page 83: Jaoo - Open Social A Standard For The Social Web

Implementing Shindig - Java

import org.apache.shindig.social.opensocial.ActivitiesService;

public class SQLActivitiesService implements ActivitiesService {

private SQLDataLayer sqlLayer;

@Inject public SQLActivitiesService(SQLDataLayer sqlLayer) { this.sqlLayer = sqlLayer; }

Code at http://chrisschalk.com/shindig_docs/io/shindig-io.html

Page 84: Jaoo - Open Social A Standard For The Social Web

Implementing Shindig - Java public ResponseItem<List<Activity>> getActivities(List<String> ids, SecurityToken token) { Map<String, List<Activity>> allActivities = sqlLayer.getActivities();

List<Activity> activities = new ArrayList<Activity>();

for (String id : ids) { List<Activity> personActivities = allActivities.get(id); if (personActivities != null) { activities.addAll(personActivities); } } return new ResponseItem<List<Activity>>(activities); }

Page 85: Jaoo - Open Social A Standard For The Social Web

Implementing - Make it a platformAdd UI Elements

App GalleryApp CanvasApp InvitesNotification Browser

Developer ResourcesDeveloper ConsoleApplication Gallery

Scale it Out!

Page 86: Jaoo - Open Social A Standard For The Social Web

Implementing - Scale it Out!Prevent Concurrency issuesReduce LatencyAdd CachingAdd more caching!

Page 87: Jaoo - Open Social A Standard For The Social Web

Usage Example: Sample ContainerStatic html sample containerNo effort to get up and runningNo database or features

Page 88: Jaoo - Open Social A Standard For The Social Web

Usage Example: PartuzaPartuza is a Example social network site, written in PHPAllows for local gadget development & testing tooUse as inspiration (or copy) for creating your own social sitehttp://code.google.com/p/partuza

Page 89: Jaoo - Open Social A Standard For The Social Web

OpenSocial for intranet, portalsSun Microsystems

Socialsite: Shindig + gadget based UI written in JavaOpen Source https://socialsite.dev.java.net/

Upcoming from Impetus

Zest: Shindig + Drupal (PHP)Zeal: Shindig + Liferay (Java)

Page 90: Jaoo - Open Social A Standard For The Social Web

SummaryBecome an OpenSocial Container

Get Shindig (PHP or Java)Look at examples & documentationImplement ServicesAdd UIScale it out

Resources & Links:

http://www.chabotc.com/gdd/

Page 91: Jaoo - Open Social A Standard For The Social Web

What is Friend Connect?Allows any site to become an OpenSocial container by simply

copying a few snippets of code into your site

http://www.google.com/friendconnect/

Page 92: Jaoo - Open Social A Standard For The Social Web
Page 93: Jaoo - Open Social A Standard For The Social Web
Page 94: Jaoo - Open Social A Standard For The Social Web
Page 95: Jaoo - Open Social A Standard For The Social Web
Page 96: Jaoo - Open Social A Standard For The Social Web
Page 97: Jaoo - Open Social A Standard For The Social Web
Page 98: Jaoo - Open Social A Standard For The Social Web
Page 99: Jaoo - Open Social A Standard For The Social Web
Page 100: Jaoo - Open Social A Standard For The Social Web
Page 101: Jaoo - Open Social A Standard For The Social Web
Page 102: Jaoo - Open Social A Standard For The Social Web

Friend Connect gives ...

Users... more ways to do more things with my friends

Site owners... more (and more engaged) traffic for my site

App developers... more reach for my apps

and ... make it easy

Page 103: Jaoo - Open Social A Standard For The Social Web

Learn more

code.google.com

Page 104: Jaoo - Open Social A Standard For The Social Web
Page 105: Jaoo - Open Social A Standard For The Social Web

Q & A

Page 106: Jaoo - Open Social A Standard For The Social Web