introduction to opensocial
DESCRIPTION
These are the slides I prepared at Barcamp Berlin 2. I had the pleasure to present this together with David Recordon and we also had a great Q&A session with probably more questions than ansersTRANSCRIPT
![Page 1: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/1.jpg)
Open Social
Christian Scholzhttp://mrtopf.de/connecthttp://comlounge.net
Google‘s
Barcamp Berlin 2
![Page 2: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/2.jpg)
Write once, run everywhere
![Page 3: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/3.jpg)
ApplicationGoogle Gadget
![Page 4: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/4.jpg)
Platform
ApplicationGoogle Gadget
![Page 5: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/5.jpg)
Platform
ApplicationGoogle Gadget
OpenSocial API
![Page 6: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/6.jpg)
Platform
ApplicationGoogle Gadget
PlatformOpenSocial API
OpenSocial API
![Page 7: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/7.jpg)
Ning
Flixter
Orkut
![Page 8: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/8.jpg)
Example
![Page 9: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/9.jpg)
Writing Applications
![Page 10: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/10.jpg)
1. Write a Google Gadget
![Page 11: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/11.jpg)
Example GG HTML
<?xml version="1.0" encoding="UTF-8" ?>
<Module> <ModulePrefs title="Go to Photo Album" height="250" scaling="false" /> <Content type="html">
<![CDATA[ <div style="text-align:center"><a id="Riggs" title="My Photo Album" target="_blank" href="http://picasaweb.google.com/doc.examples/ShelfBoy"> <img border="0" alt="Photo" src="http://doc.examples.googlepages.com/Riggsie-OP.jpg" title="Click Here."></a> </div>
]]> </Content></Module>
![Page 12: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/12.jpg)
2. Importing Open Social
<ModulePrefs title="Title of Your Application"> <Require feature="opensocial-0.5"/></ModulePrefs>
![Page 13: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/13.jpg)
3. Using Open Social
function onLoadFriends(dataResponse) { // do something with the dataResponse }
/** * Request for friend information when the page loads. */ function getData() { document.getElementById('message').innerHTML = 'Requesting friends...'; var req = opensocial.newDataRequest(); req.add(req.newFetchPersonRequest('VIEWER'), 'viewer'); req.add(req.newFetchPeopleRequest ('VIEWER_FRIENDS'), 'viewerFriends'); req.send(onLoadFriends); };
![Page 14: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/14.jpg)
3. Using Open Social
/** * Parses the response to the friend information request and generates * html to list the friends by their display name. * * @param {Object} dataResponse Friend information that was requested. */ function onLoadFriends(dataResponse) { var viewer = dataResponse.get('viewer').getData(); var html = 'Friends of ' + viewer.getDisplayName(); html += ':<br><ul>'; var viewerFriends = dataResponse.get('viewerFriends').getData(); viewerFriends.each(function(person) { html += '<li>' + person.getDisplayName(); }); html += '</ul>'; document.getElementById('message').innerHTML = html; };
![Page 15: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/15.jpg)
3 APIs
1. People and Relationships2. Persistence3. Activities
![Page 16: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/16.jpg)
3 APIs
1. People and Relationships2. Persistence3. Activities
How are users between different social networks connected?
![Page 17: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/17.jpg)
Hosting Applications
![Page 18: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/18.jpg)
OpenSocial Service Provider Interface
* Adding and removing friends * Adding and removing apps * Storing activities * Retrieving activity streams for self and friends * Storing and retrieving per-app and per-app-per-user data
![Page 19: Introduction to OpenSocial](https://reader036.vdocuments.us/reader036/viewer/2022081907/54bf0b884a795933508b461f/html5/thumbnails/19.jpg)
more documentationstill to comewith SDK