Sie sind auf Seite 1von 17

Open Social 0.7/0.

8
Evolution AND revolution

Chris Thorpe
Developer Platform Evangelist @ MySpace UK

Architecture diagram courtesy of Chris Bissell (aged 36) and Max Newbould (aged 27)

Facebook Developer Garage London | 8 October 2008


Current release Next release

OpenSocial 0.7 OpenSocial 0.8

XML based gadets


XML based gadets
JavaScript and APIs
JavaScript and APIs
REST APIs / RESTful
protocols
Markup language

Facebook Developer Garage London | 8 October 2008


Facebook Developer Garage London | 8 October 2008
Facebook Developer Garage London | 8 October 2008
Facebook Developer Garage London | 8 October 2008
Facebook Developer Garage London | 8 October 2008
Next release

OpenSocial 0.8

XML based gadets


JavaScript and APIs
REST APIs / RESTful
protocols Markup language

Facebook Developer Garage London | 8 October 2008


OpenSocial 0.8
RESTful protocol

Access OpenSocial data without JavaScript


- Use simple REST calls instead (OAuth authenticated
- Doesn’t require a gadget container
- Allows for full server-server communication
- Allows for device-server communication

Client libraries currently in


- Java
- PHP
- Python

Facebook Developer Garage London | 8 October 2008


OpenSocial 0.8
RESTful protocol
Person example

Facebook Developer Garage London | 8 October 2008


OpenSocial 0.8
RESTful protocol
AppData

Facebook Developer Garage London | 8 October 2008


OpenSocial 0.8
Markup language

JSP 2.0 EL-like markup


- create reuseable and OO style markup components
- some components provided by container
- building nested components is very easy
- components can be namespaced so you can
build libraries

Facebook Developer Garage London | 8 October 2008


OpenSocial 0.8

Facebook Developer Garage London | 8 October 2008


OpenSocial 0.8
<Module>
<ModulePrefs title="My Friends">
<Require feature="opensocial-0.8"/>
<Optional feature="content-rewrite">
<Param name="include-tags"/>
</Optional>
</ModulePrefs>
<Content type="html">
<script type="text/javascript"
src="http://ostemplates-demo.appspot.com/ostemplates.js"></script>

<script type="text/os-template">
<b>${owner.displayName}'s friends</b>
<ul>
<li repeat="friends">${displayName}</li>
</ul>
</script>

<script type="text/javascript">
function loadData() {
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest('OWNER'), 'owner');
var idSpecFriends = opensocial.newIdSpec({'userId':'OWNER', 'groupId':'FRIENDS'});
req.add(req.newFetchPeopleRequest(idSpecFriends), 'friends');
req.send(function(data) {os.Container.processDocument(data);});
}
gadgets.util.registerOnLoadHandler(loadData);
</script>

</Content>
</Module>

Facebook Developer Garage London | 8 October 2008


OpenSocial 0.8
<!--
viewer: { 'id': 100, 'name': 'David' },
viewerFriends: [
{ 'id': 101, 'name': 'Jason' },
{ 'id': 102, 'name': 'Mark' }
]
-->

<script type="text/os-template" tag="my:Person">


<a href="#${id}">${name}</a>
</script>

<script type="text/os-template">
<div repeat="viewerFriends">
<my:Person context="Top.viewer"/> and <my:Person/> are friends.
</div>
</script>

Facebook Developer Garage London | 8 October 2008


Why write clientside apps with JavaScript?

- Mashups on multiple datasources


- Easier to scale (processing sits on client)
- Asynchronicity is important for scale
- hard to do in server based apps which are
semi-stateless/stateless
- scalability in server based apps is a real issue in
social software, especially in large friend graph
situations

Facebook Developer Garage London | 8 October 2008


Resources
OpenSocial 0.8
http://www.opensocial.org/

OpenSocial 0.8 specs


http://www.opensocial.org/Technical-Resources

OpenSocial 0.8 RESTful protocols


http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/restful-proto
/

OpenSocial 0.8 Template examples


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

OpenSocial Blog
http://opensocialapis.blogspot.com/

OpenSocial 0.8 on MySpace


http://developer.myspace.com/community/blogs/

Facebook Developer Garage London | 8 October 2008


Chris Thorpe
Developer Platform Evangelist @ MySpace UK

cthorpe@myspace.com

http://twitter.com/ukdevelopers
http://www.myspace.
com/ukdevelopers
http://twitter.com/jaggeree

Facebook Developer Garage London | 8 October 2008

Das könnte Ihnen auch gefallen