open social shindig preso for fb and opensocial meetup

50
Chris Schalk, Google Developer Advocate FaceBook and OpenSocial Developer Meetup - 12/10/2008 and Apache Shindig

Post on 13-Sep-2014

8.348 views

Category:

Technology


2 download

DESCRIPTION

This is a presentation on OpenSocial and Shindig given to a Facebook/OpenSocial developer meetup in Palo Alto on Dec 10, 2008

TRANSCRIPT

Page 1: Open Social Shindig Preso for FB and OpenSocial Meetup

Chris Schalk, Google Developer Advocate

FaceBook and OpenSocial Developer Meetup - 12/10/2008

and Apache Shindig

Page 2: Open Social Shindig Preso for FB and OpenSocial Meetup

2

Agenda

• OpenSocial Concepts

• Apache Shindig

• The OpenSocial Specification Process

Page 3: Open Social Shindig Preso for FB and OpenSocial Meetup

3

Agenda

• OpenSocial Concepts

• Apache Shindig

• The OpenSocial Specification Process

Page 4: Open Social Shindig Preso for FB and OpenSocial Meetup
Page 5: Open Social Shindig Preso for FB and OpenSocial Meetup
Page 6: Open Social Shindig Preso for FB and OpenSocial Meetup

Too many platforms!

Page 7: Open Social Shindig Preso for FB and OpenSocial Meetup

Standards based

OpenSocial

Write once… Deploy everywhere

Page 8: Open Social Shindig Preso for FB and OpenSocial Meetup

Massive exposure foryour apps!

Page 9: Open Social Shindig Preso for FB and OpenSocial Meetup

9

OpenSocial Concepts

What is OpenSocial?

“OpenSocial defines a common set of APIs based on Open Standardsfor building social applications across multiple websites”

Page 10: Open Social Shindig Preso for FB and OpenSocial Meetup

10

OpenSocial Concepts

Who own’s OpenSocial?

OpenSocial is managed under the auspices of the“OpenSocial Foundation” - http://www.opensocial.org

No!?

Page 11: Open Social Shindig Preso for FB and OpenSocial Meetup

Some OpenSocial Partners

Page 12: Open Social Shindig Preso for FB and OpenSocial Meetup

In one year: has over 600 Million user reach!

Page 13: Open Social Shindig Preso for FB and OpenSocial Meetup

13

More OpenSocial numbers

315M+ app Installations

85M+ daily canvas page views

7,500+ applications

20+ live containers

Page 14: Open Social Shindig Preso for FB and OpenSocial Meetup

14

Where is OpenSocial live today?

Applications live to Users:

• LinkedIn - New• MySpace• orkut• Hi5• Freebar• Friendster• Webon from Lycos• IDtail• YiQi• Netlog• Hyves• Ning• Fanbox• XiaoNei• Mail.ru• Socialtext• 51.com

Initial Developer Sandboxes:

• iGoogle• Yahoo!• Minglebox• imeem• Viadeo• CityIN• Tianya• Ning• Plaxo Pulse• Lokalisten• … many more in the pipeline!

http://wiki.opensocial.org

Page 15: Open Social Shindig Preso for FB and OpenSocial Meetup

15

Not just Social Network Sites

• Social network sites - Profiles and home pagesex: MySpace, Hi5

• Personal dashboards – Widgetsex: iGoogle, My Yahoo

• Sites based around a Social Objectex: Flickr, YouTube

• Enterprise, Professionalex: LinkedIn, Oracle, SalesForce.com

• Any web site

Page 16: Open Social Shindig Preso for FB and OpenSocial Meetup

16

OpenSocial Roadmap

• Version 0.5 was released in a “developer release” on Nov1st.

• First “sandbox” was made available on Orkut

• Version 0.6 was released in December• Initial version of Shindig server software was launched as Apacheincubator project• Other sandboxes came live - Hi5, Ning, Plaxo …

• Version 0.7 (production) was released in January• MySpace, Hi5, Orkut currently running with 0.7

Page 17: Open Social Shindig Preso for FB and OpenSocial Meetup

17

OpenSocial Roadmap

• Version v0.8 is current

• Latest evolution of OpenSocial as defined by theOpenSocial development community

• Updated JavaScript API• Now contains a RESTful API

• hi5, MySpace, orkut, iGoogle now support 0.8

• Specification:http://www.opensocial.org/Technical-Resources/opensocial-spec-v08

Page 18: Open Social Shindig Preso for FB and OpenSocial Meetup

18

OpenSocial v0.8.1 spec is here

• Specification is now published• Updates include:

• RESTful Protocol updates• JSON RPC Protocol

• Specification:http://sites.google.com/a/opensocial.org/opensocial/Technical-Resources/opensocial-spec-v081

Page 19: Open Social Shindig Preso for FB and OpenSocial Meetup

19

OpenSocial 0.9 - Future Directions

• Goal:

– Enable a faster development experience that is both secure andefficient

• Solution: “Opensocial Templates”!

OS Templates core principles:

• Client-side and server-side processing

• Standard set of tags with extensibility model

– Example: <os:ShowPerson>

• http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates

– Demo: http://ostemplates-demo.appspot.com/

Page 20: Open Social Shindig Preso for FB and OpenSocial Meetup

20

To follow the progress of the Spec…

http://groups.google.com/group/opensocial-and-gadgets-spec

Page 21: Open Social Shindig Preso for FB and OpenSocial Meetup

21

Demonstration: Building OpenSocial Applications

Page 22: Open Social Shindig Preso for FB and OpenSocial Meetup

22

Agenda

• OpenSocial Concepts

• Apache Shindig

• The OpenSocial Specification Process

Page 23: Open Social Shindig Preso for FB and OpenSocial Meetup

23

How do you host OpenSocial Applications?

1. Can build your own server that implementsOpenSocial specification…

2. Or can use “Shindig” - Reference implementation forOpenSocial

Page 24: Open Social Shindig Preso for FB and OpenSocial Meetup

24

Hosting OpenSocial Applications

What is Shindig?

• Apache Incubator Project

• Currently available in Java and PHP

• Shindig Components:• Gadget Server

•Parses gadget XML, renders as HTML/JS/CSS

• OpenSocial Data Server

• Plugs into social graph data

• RESTful, RPC protocol services

• Downloaded JavaScript libraries

•Core gadgets, OpenSocial client JavaScript environment

http://incubator.apache.org/shindig

Page 25: Open Social Shindig Preso for FB and OpenSocial Meetup

25

Why use Shindig?

• Strong Open Source community

• High quality production-ready code• Used by: hi5, orkut, iGoogle, Netlog, Hyves …

• Synchronized with specification

• Language neutral (Java, PHP, …)• .Net coming soon!

Page 26: Open Social Shindig Preso for FB and OpenSocial Meetup

26 26

How Shindig works

• Gadget Server

• OpenSocial Data Server

Yoursite.com

GadgetGadgetServer

OpenSocialDataServer

Shindig

Page 27: Open Social Shindig Preso for FB and OpenSocial Meetup

27 27

Java Shindig components

• Gadget Server

• OpenSocial Data Server

Yoursite.com

GadgetGadgetServer

OpenSocialDataServer

Shindig

Page 28: Open Social Shindig Preso for FB and OpenSocial Meetup

28

Shindig success at hi5

• Big Traffic

• 10k req/sec Edge

• 6k req/sec Origin

• Hundreds of Developers

• 1800+ Apps

• 1 Billion hits/day

… on 42 Shindig servers

28

Page 29: Open Social Shindig Preso for FB and OpenSocial Meetup

29

Demonstration: Trying out Shindig

29

Page 30: Open Social Shindig Preso for FB and OpenSocial Meetup

30

Adapting Shindig

• Adapting Shindig to your own social data

Gadget Server

OpenSocialDataServer

Shindig

ActivityService

PersonService

AppDataService

Social GraphData

Page 31: Open Social Shindig Preso for FB and OpenSocial Meetup

31

Demonstration: Shindig with MySQL

31

Page 32: Open Social Shindig Preso for FB and OpenSocial Meetup

32

RESTful and RPC protocols

Shindig now supports both REST and RPC protocols as of v0.8!

Opens new development models

• Background processing.

• Easier Flash integration.

• Mobile applications.

Page 33: Open Social Shindig Preso for FB and OpenSocial Meetup

33

Communication methods:

•RESTful (Representational State Transfer)

•RPC (Remote Procedure Call) ‏

Formats:

•XML

•JSON

•AtomPub

RESTful and RPC protocols

Page 34: Open Social Shindig Preso for FB and OpenSocial Meetup

34

RESTful and RPC protocolsREST:

•Resources are URLs.

/people/{guid}/@all

• All people connected to the given user:Example - People:

/people/{guid}/@friends

• All friends of the given user:

/people/{guid}/@self

• Profile of the given user:

/people/@me/@self

• Profile of the authenticated user:

/people/@supportedFields

• Supported Person fields:

Page 35: Open Social Shindig Preso for FB and OpenSocial Meetup

35

RESTful and RPC protocols

• Response format (JSON, XML, AtomPub)‏

• Request extra fields

• Filtering:

• Paging:

fields={-join|,|field}.

filterBy={fieldname}filterOp={operation}filterValue={value}updatedSince={xsdDateTime}networkDistance={networkDistance}

count={count} sortBy={fieldname}sortOrder={order}startIndex={startIndex}

format={format}

Querystring parameters customize requests:

Page 36: Open Social Shindig Preso for FB and OpenSocial Meetup

36

<person xmlns="http://ns.opensocial.org/2008/opensocial"> <id></id> <displayName></displayName> <name> <unstructured>Jane Doe</unstructured> </name> <gender>female</gender></person>

RESTful and RPC protocolsREST responses (Person):

{ "id" : "example.org:34KJDCSKJN2HHF0DW20394", "displayName" : "Janey", "name" : {"unstructured" : "Jane Doe"}, "gender" : "female"}

• JSON:

• XML:

Page 37: Open Social Shindig Preso for FB and OpenSocial Meetup

37

RESTful and RPC protocolsREST responses (Person):

• AtomPub:

<entry xmlns="http://www.w3.org/2005/Atom"> <content type="application/xml"> <person xmlns="http://ns.opensocial.org/2008/opensocial"> <name> <unstructured>Jane Doe</unstructured> </name> <gender>female</gender> </person> </content> <title/> <updated>2003-12-13T18:30:02Z</updated> <author/> <id>urn:guid:example.org:34KJDCSKJN2HHF0DW20394</id></entry>

Page 38: Open Social Shindig Preso for FB and OpenSocial Meetup

38

RESTful and RPC protocols

REST has some disadvantages:

•Batch support requires multiple HTTP requests, or a contrived URL

scheme.

•Specifying multiple users via querystring is difficult. Is

?uid=1234,5678 the same resource as ?uid=5678,1234 ?

Page 39: Open Social Shindig Preso for FB and OpenSocial Meetup

39

RESTful and RPC protocolsRPC:

•One endpoint - parameters specify methods to call.

•Batch support.

•Specify collections of users through passed arguments, not URLs.

POST /rpc HTTP/1.1Host: api.example.orgAuthorization: <Auth token>Content-Type: application/json{ "method" : "people.get", "id" : "myself", "params" : { "userid" : "@me", "groupid" : "@self" }}

Example - Fetch current user:

• RequestHTTP/1.x 207 Multi-StatusContent-Type: application/json{ "id" : "myself", "result" : { "id" : "example.org:34KJDCSKJN2HHF0DW20394", "name" : { "unstructured" : "Jane Doe"}, "gender" : "female" }}

• Response

Page 40: Open Social Shindig Preso for FB and OpenSocial Meetup

40

RESTful and RPC Client libraries

Client libraries are being created for PHP, Java, Ruby and Python.

• Help you connect to OpenSocial containers, and work with social

data on your server.

http://code.google.com/p/opensocial-java-client/

http://code.google.com/p/opensocial-ruby-client/

http://code.google.com/p/opensocial-php-client/

Page 41: Open Social Shindig Preso for FB and OpenSocial Meetup

41

RESTful and RPC protocols

Sample: Fetch a user’s friends from Shindig:

OpenSocialClient c = new OpenSocialClient("myhost.com");

c.setProperty(OpenSocialClient.Properties.REST_BASE_URI, "http://localhost:8080/social/rest/"); try { OpenSocialPerson p = c.fetchPerson("john.doe"); System.out.println(p.getDisplayName());

Collection<OpenSocialPerson> friends = c.fetchFriends("john.doe"); for (OpenSocialPerson friend : friends) { System.out.println(friend.getDisplayName()); }

} catch (Exception e) {

}

Page 42: Open Social Shindig Preso for FB and OpenSocial Meetup

42

Demonstration: Trying out the REST client library

42

Page 43: Open Social Shindig Preso for FB and OpenSocial Meetup

43

Example container applications

Java• Socialsite

• Created by Sun

• Flexible social graph

• Completely Open Source

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

Page 44: Open Social Shindig Preso for FB and OpenSocial Meetup

44

Example container applications

PHP• Partuza

• Created by Google employee

• Hosted on Google Projects

• Based on PHP Shindig

http://code.google.com/p/partuza/

Page 45: Open Social Shindig Preso for FB and OpenSocial Meetup

45

Agenda

• OpenSocial Concepts

• Apache Shindig

• The OpenSocial Specification Process

Page 46: Open Social Shindig Preso for FB and OpenSocial Meetup

46

The OpenSocial specification process

Page 47: Open Social Shindig Preso for FB and OpenSocial Meetup

47

The OpenSocial specification process

Page 48: Open Social Shindig Preso for FB and OpenSocial Meetup

48

The OpenSocial specification process

Page 49: Open Social Shindig Preso for FB and OpenSocial Meetup

49

Useful Links

Homepage & specification: http://www.opensocial.org

New Wiki! (Compliancy, Cross container development …)• http://wiki.opensocial.org

Get on the forums:• http://groups.google.com/group/opensocial

Subscribe to the Shindig mailing list:• [email protected]

Help shape the specification:• http://groups.google.com/group/opensocial-and-gadgets-spec/

Check out Shindig:• http://incubator.apache.org/shindig

OS Templates:• http://groups.google.com/group/opensocial-and-gadgets-spec/web/opensocial-templates

Page 50: Open Social Shindig Preso for FB and OpenSocial Meetup

50

Questions

Q&A