The document discusses OpenSocial, an open-source framework that allows developers to build social applications. It describes what OpenSocial is, how it works through APIs and XML, and some of its issues like instability and a read-only API. The author expresses disliking OpenSocial and trying unsuccessfully to scratch their own itch by using Ruby on Rails instead of a conceptual framework.
16. • +350 milhões de usuários
• +150 milhões de instalações
• +5 mil aplicativos
• +100 containers
• +25 mil desenvolvedores
• 10 milhões de acessos por dia
24. 4. XML
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Standard gadget structure">
<Require feature="opensocial-0.8"/>
</ModulePrefs>
<Content type="html">
<![CDATA[
Olá galera do Rails for Kids!
]]>
</Content>
</Module>
25. <?xml version="1.0" encoding="UTF-8" ?>
4. XML
<Module>
<ModulePrefs title="List Friends Example">
<Require feature="opensocial-0.8"/>
</ModulePrefs>
<Content type="html">
<![CDATA[
<script type="text/javascript">
/**
* Request the OWNER and OWNER's friends.
*/
function request() {
var idspec = opensocial.newIdSpec({ "userId" : "OWNER", "groupId" : "FRIENDS" });
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER), "get_owner");
req.add(req.newFetchPeopleRequest(idspec), "get_friends");
req.send(response);
};
/**
* Parses the response and generates html to list the names of the owner and
* his or her friends.
*
* @param {Object} dataResponse Friend information that was requested.
*/
function response(dataResponse) {
var owner = dataResponse.get('get_owner').getData();
var friends = dataResponse.get('get_friends').getData();
var html = 'Friends of ' + owner.getDisplayName();
html += ':<br><ul>';
friends.each(function(person) {
html += '<li>' + person.getDisplayName() + '</li>';
});
html += '</ul>';
document.getElementById('message').innerHTML = html;
};
// Execute the request function when the application is finished loading.
gadgets.util.registerOnLoadHandler(request);
</script>
<div id="message"> </div>
]]>
</Content>
</Module>