OpenSocial Concepts
What is OpenSocial?
“OpenSocial defines a common set of APIs based on Open Standards
for building social applications across multiple websites”
9
OpenSocial Concepts
Who own’s OpenSocial?
? No!
OpenSocial is managed under the auspices of the
“OpenSocial Foundation” - http://www.opensocial.org
10
Where is OpenSocial live today?
Applications live to Users: Initial Developer Sandboxes:
• LinkedIn - New • iGoogle
• MySpace • Yahoo!
• orkut • Minglebox
• Hi5 • imeem
• Freebar
• Viadeo
• Friendster
• CityIN
• Webon from Lycos
• IDtail
• Tianya
• YiQi • Ning
• Netlog • Plaxo Pulse
• Hyves • Lokalisten
• … many more in the pipeline!
• Ning
• Fanbox
• XiaoNei
• Mail.ru
• Socialtext
• 51.com http://wiki.opensocial.org
14
Not just Social Network Sites
• Social network sites - Profiles and home pages
ex: MySpace, Hi5
• Personal dashboards – Widgets
ex: iGoogle, My Yahoo
• Sites based around a Social Object
ex: Flickr, YouTube
• Enterprise, Professional
ex: LinkedIn, Oracle, SalesForce.com
• Any web site
15
OpenSocial Roadmap
• Version 0.5 was released in a “developer release” on Nov
1st.
• First “sandbox” was made available on Orkut
• Version 0.6 was released in December
• Initial version of Shindig server software was launched as Apache
incubator project
• Other sandboxes came live - Hi5, Ning, Plaxo …
• Version 0.7 (production) was released in January
• MySpace, Hi5, Orkut currently running with 0.7
16
OpenSocial Roadmap
• Version v0.8 is current
• Latest evolution of OpenSocial as defined by the
OpenSocial 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
17
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
18
OpenSocial 0.9 - Future Directions
• Goal:
– Enable a faster development experience that is both secure and
efficient
• 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/
19
To follow the progress of the Spec…
http://groups.google.com/group/opensocial-and-gadgets-spec
20
Agenda
• OpenSocial Concepts
• Apache Shindig
• The OpenSocial Specification Process
22
How do you host OpenSocial Applications?
1. Can build your own server that implements
OpenSocial specification…
2. Or can use “Shindig” - Reference implementation for
OpenSocial
23
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
24
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!
25
How Shindig works
• Gadget Server
• OpenSocial Data Server
Shindig
Yoursite.com
Gadget
Gadget Server
OpenSocial
DataServer
26 26
Java Shindig components
• Gadget Server
• OpenSocial Data Server
Shindig
Yoursite.com
Gadget
Gadget Server
OpenSocial
DataServer
27 27
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 28
Adapting Shindig
• Adapting Shindig to your own social data
Shindig
Gadget Server
OpenSocialDataServer
ActivityService Social Graph
PersonService Data
AppDataService
30
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.
32
RESTful and RPC protocols
Communication methods:
•RESTful (Representational State Transfer)
•RPC (Remote Procedure Call)
Formats:
•XML
•JSON
•AtomPub
33
RESTful and RPC protocols
REST:
•Resources are URLs.
Example - People:
• All people connected to the given user:
/people/{guid}/@all
• All friends of the given user:
/people/{guid}/@friends
• Profile of the given user:
/people/{guid}/@self
• Profile of the authenticated user:
/people/@me/@self
• Supported Person fields:
/people/@supportedFields
34
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 ?
38
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/
40
RESTful and RPC protocols
Sample: Fetch a user’s friends from Shindig:
OpenSocialClient c = new OpenSocialClient(quot;myhost.comquot;);
c.setProperty(OpenSocialClient.Properties.REST_BASE_URI, quot;http://localhost:8080/social/rest/quot;);
try {
OpenSocialPerson p = c.fetchPerson(quot;john.doequot;);
System.out.println(p.getDisplayName());
Collection<OpenSocialPerson> friends = c.fetchFriends(quot;john.doequot;);
for (OpenSocialPerson friend : friends) {
System.out.println(friend.getDisplayName());
}
} catch (Exception e) {
}
41
Example container applications
Java
• Socialsite
• Created by Sun
• Flexible social graph
• Completely Open Source
https://socialsite.dev.java.net/
43
Example container applications
PHP
• Partuza
• Created by Google employee
• Hosted on Google Projects
• Based on PHP Shindig
http://code.google.com/p/partuza/
44
Agenda
• OpenSocial Concepts
• Apache Shindig
• The OpenSocial Specification Process
45
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:
• shindig-dev-subscribe@incubator.apache.org
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
49