View
8.346
Download
2
Embed Size (px)
DESCRIPTION
This is a presentation on OpenSocial and Shindig given to a Facebook/OpenSocial developer meetup in Palo Alto on Dec 10, 2008
Citation preview
Chris Schalk, Google Developer Advocate
FaceBook and OpenSocial Developer Meetup - 12/10/2008
and Apache Shindig
2
Agenda
• OpenSocial Concepts
• Apache Shindig
• The OpenSocial Specification Process
3
Agenda
• OpenSocial Concepts
• Apache Shindig
• The OpenSocial Specification Process
Too many platforms!
Standards based
OpenSocial
Write once… Deploy everywhere
Massive exposure foryour apps!
9
OpenSocial Concepts
What is OpenSocial?
“OpenSocial defines a common set of APIs based on Open Standardsfor building social applications across multiple websites”
10
OpenSocial Concepts
Who own’s OpenSocial?
OpenSocial is managed under the auspices of the“OpenSocial Foundation” - http://www.opensocial.org
No!?
Some OpenSocial Partners
In one year: has over 600 Million user reach!
13
More OpenSocial numbers
315M+ app Installations
85M+ daily canvas page views
7,500+ applications
20+ live containers
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
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
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
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
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
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/
20
To follow the progress of the Spec…
http://groups.google.com/group/opensocial-and-gadgets-spec
21
Demonstration: Building OpenSocial Applications
22
Agenda
• OpenSocial Concepts
• Apache Shindig
• The OpenSocial Specification Process
23
How do you host OpenSocial Applications?
1. Can build your own server that implementsOpenSocial specification…
2. Or can use “Shindig” - Reference implementation forOpenSocial
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
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!
26 26
How Shindig works
• Gadget Server
• OpenSocial Data Server
Yoursite.com
GadgetGadgetServer
OpenSocialDataServer
Shindig
27 27
Java Shindig components
• Gadget Server
• OpenSocial Data Server
Yoursite.com
GadgetGadgetServer
OpenSocialDataServer
Shindig
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
29
Demonstration: Trying out Shindig
29
30
Adapting Shindig
• Adapting Shindig to your own social data
Gadget Server
OpenSocialDataServer
Shindig
ActivityService
PersonService
AppDataService
Social GraphData
31
Demonstration: Shindig with MySQL
31
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.
33
Communication methods:
•RESTful (Representational State Transfer)
•RPC (Remote Procedure Call)
Formats:
•XML
•JSON
•AtomPub
RESTful and RPC protocols
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:
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:
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:
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>
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 ?
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
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/
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) {
}
42
Demonstration: Trying out the REST client library
42
43
Example container applications
Java• Socialsite
• Created by Sun
• Flexible social graph
• Completely Open Source
https://socialsite.dev.java.net/
44
Example container applications
PHP• Partuza
• Created by Google employee
• Hosted on Google Projects
• Based on PHP Shindig
http://code.google.com/p/partuza/
45
Agenda
• OpenSocial Concepts
• Apache Shindig
• The OpenSocial Specification Process
46
The OpenSocial specification process
47
The OpenSocial specification process
48
The OpenSocial specification process
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
50
Questions
Q&A