List of OpenSocial Containers

Thursday, August 25, 2011 at 1:45:00 PM

Recently there was a thread going around the OpenSocial and Gadgets Specification discussion board about providing an updated list of OpenSocial containers, both at the open and enterprise levels.

From this discussion, we have put together a living document to provide a list of those OpenSocial containers and implementers that we are aware of, including links to their associated information pages or developer networks. You can view the list here.


We Need Your Help

Since this is a living document, the content will always be changing as new containers surface or if we have left something off of the list. For everyone working with different container implementations, we ask that you review the list and help update the content if something is incorrect or missing. We really need the help from container implementers, users and those of you with an extensive OpenSocial container knowledge base to help out.

Thank you everyone.

Jonathan LeBlanc
Jonathan LeBlanc ()
Jonathan LeBlanc is a principal developer evangelist with X.commerce. Jonathan has been a member of the OpenSocial community for over three years and is the author of O'Reilly's "Programming Social Applications".

Announcing the Release of the OpenSocial 2.0 Specification

Thursday, August 18, 2011 at 4:28:00 PM

Following the 11:59 PDT voting cutoff last night, version 2.0 of the OpenSocial specification has officially passed with 22 positive and 0 negative votes.

Version 2 of the OpenSocial specification opens up integration with other well known open source social specifications, ties in both a simplified gadget format as well as new powerful tools, plus announces some deprecated features.

Some of the major revisions to the specification include:

  • Activity Streams support: Activity Stream provides a mechanism for defining rich and detailed social activities, defined in a simple actor / object / target format. The adoption of this open specification allows OpenSocial to not only provide richer data sources but also to be interoperable with more open streams.

  • Deprecated support for ATOM: It was determined that the ATOM serialization format for OpenSocial information was not being utilized in practice. Since there were a number of adjacent specification utilizing JSON for the preferred data format, the community has decided to deprecate support for ATOM.

  • Simplified gadget format: Providing a mechanism for embedding template libraries into a gadget specification file, the ability to integrate data pipelining and templating features within a gadget has been greatly simplified.

  • Embedded Experiences: The community saw a need to provide a mechanism for providing embedded experiences directly within the gadget. By integrating these features, the content host is able to tell a service how to render its content instead of having the service figure it out themselves. This will provide a higher degree of control over data in a gadget.

  • New Incubating API

    • OAuth 2 support: The OpenSocial 2.0 specification now includes support for OAuth 2. Since the OAuth 2.0 specification has not been finalized by the time of this release, OAuth 2 support is currently in an incubating mode. Currently revision 20 of the OAuth 2 specification is being integrated. Support for OAuth 1.0a is still included in the OpenSocial 2.0 specification and has not been deprecated.

    • Common Container: In OpenSocial 2.0, a new optional specification has been added for a common container API. The goal is to simplify the container and gadget integration model. It provides a set of common services that Container developers can leverage for features like in-browser Gadget lifecycle event callbacks, embedded experiences, and selection and action handlers.
Here are a few links that will help you get up to speed on the recent changes and additions:In addition to this announcement, Andrew Davis has another piece of great news on the Shindig side:
Along with releasing the OpenSocial 2.0 spec today, the OpenSocial Foundation is working together with our members companies, and implementor friends at Shindig are proud to announce the availability of the first OpenSocial 2.0 Container, running the latest Shindig 3.0 build, the Open Social Sandbox, at http://sandbox.opensocial2.org:8080/. The site is a live demo of the latest features of the OpenSocial 2.0 spec including Embedded Experiences, Declarative Actions, OpenSearch and powerful new open gadgets APIs to enable gadgets to jump out of the box. The site provides tutorials, demo videos and is geared towards enabling gadget developers immediately to build new gadgets, and test them out on the site through the "Customize" button.
Lastly, I wanted to say thank you to the entire community and dedicated participants who have made this major release possible.

Jonathan LeBlanc
Jonathan LeBlanc ()
Jonathan LeBlanc is a principal developer evangelist with X.commerce. Jonathan has been a member of the OpenSocial community for over three years and is the author of O'Reilly's "Programming Social Applications".

Vote Now! OpenSocial and Open Source Presentations at SXSW

Wednesday, August 17, 2011 at 6:12:00 PM

As a followup to our OpenSocial and SXSW Interactive 2012 post last month, we wanted to make available the links to the OpenSocial and associated technology proposals that have been submitted to the conference.

We would all greatly appreciate it if you could vote up these proposals to ensure that we have a technology presence at the conference next year, presenting the extensive new technology stack that is inherent within OpenSocial 2.0. There are a total of 3178 proposals in for this year and 30% of the decision-making process is up to community votes, so the more votes and comments we can get the better.

The proposals that we have available are:
If you have a proposal on the technology or features behind OpenSocial I'd be glad to add it into this blog post - please comment on this post with the details.

Thanks everyone.

Jonathan LeBlanc
Jonathan LeBlanc ()
Jonathan LeBlanc is a principal developer evangelist with X.commerce. Jonathan has been a member of the OpenSocial community for over three years and is the author of O'Reilly's "Programming Social Applications".

Building Dynamic Applications with Data Pipelining, Templating and YQL

Wednesday, August 10, 2011 at 4:12:00 PM

Hello again everyone,

Today I wanted to go over one of the interesting things that you can do with OpenSocial using templating and data pipelining. Since these were introduced in version 0.9 of the specification, this functionality will not be available if:

  • The container that you are using does not support OpenSocial version 0.9 or later.
  • The container that you are using does not support data pipelining or templating.
With that said, let's get right down to an example. For this example, we're going to go through a few steps in order to scrape and display the recent headlines from Reddit:
  • We will use data pipelining to load in the headlines from Reddit.
  • The URL of the data pipe will be a dynamic call to the Yahoo! Query Language (YQL). YQL will be used to scrape the HTML from the page, then use an xpath to drill down to the repeating anchor tags that denote the headlines.
  • Lastly, from the JSON data that is returned back from YQL into the data pipe, we're going to use OpenSocial templating to display out the headline results.
Let's take a look at the gadget code behind this:
<?xml version="1.0" encoding="utf-8"?>

<Module>
<ModulePrefs title="Reddit Headline Fetch"
title_url="http://www.jcleblanc.com"
description="Obtains reddit.com headlines via YQL"
author="Jonathan LeBlanc">
<Require feature="opensocial-0.9"/>
<Require feature="opensocial-data" />
<Require feature="opensocial-templates" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<script type="text/os-data" xmlns:os="http://ns.opensocial.org/2008/markup">
<os:HttpRequest key="reddit" href="http://query.yahooapis.com/v1/public/yql?
q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fwww.reddit.com
%22%20and%0A%20%20%20%20%20%20xpath%3D'%2F%2Fa%5B%40class%3D%22title%22%5D'
&format=json"/>
</script>
<script type="text/os-template" require="reddit">
<ul>
<li repeat="${reddit.content.query.results.a}">
<a href="${Cur.href}">${Cur.content}</a>
</li>
</ul>
</script>
]]>
</Content>
</Module>
Let's break down the components of this gadget. First let's start with the meta data within the <ModulePrefs> node. There are three features that we will need to require:
   <Require feature="opensocial-0.9"/>

<Require feature="opensocial-data" />
<Require feature="opensocial-templates" />
First we have the OpenSocial version that we want to include. For our needs we can include version 0.9 of the specification since that will allow us to include the other features we need, namely our second and third Require statements for opensocial-data (Data Pipelining) and opensocial-templates (Templating). These three will give us the features that we need for the example.

Next we have the innards of the <Content> node. Let's explore the first <script> block:
   <script type="text/os-data" xmlns:os="http://ns.opensocial.org/2008/markup">

<os:HttpRequest key="reddit" href="http://query.yahooapis.com/v1/public/yql?
q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fwww.reddit.com
%22%20and%0A%20%20%20%20%20%20xpath%3D'%2F%2Fa%5B%40class%3D%22title%22%5D'
&format=json"/>
</script>
This is our data pipelining section. When the gadget loads in the container that we are running it in, this section will issue an HTTP request to populate an object with the return value of the request. In our case this will be a GET request to the YQL service.

To define a data pipe, we set the type of the script block to text/os-data and then define the os XML namespace. Within the script block, we set the object that we want the data returned to to be "reddit". We then issue a data pipelining HTTP GET request to the YQL service, using the href attribute. This URL used includes the following components:
  • The public YQL URL: http://query.yahooapis.com/v1/public/yql
  • q: The YQL query to run, placed as a query string parameter.
  • format: The format to return our data in, in our case JSON. This is also placed as a query string parameter.
If we look at the query that we are using, we can see what the components of the request are:
  SELECT * FROM html WHERE url="http://www.reddit.com"

AND xpath='//a[@class="title"]'
YQL uses a query syntax much akin to SQL. In our request we are using the html table, which defines request functionality to allow us to scrape data from an HTML page and then apply an xpath to drill down to the nodes on the page that we want to capture. In our case, we are capturing all data from http://www.reddit.com where the xpath (or nodes that we want to return) is any anchor tag that contains a class of title. If we explore the source code of http://www.reddit.com we can see that each title on the page is indeed an anchor tag with a class of title. At the end of the request the reddit object should now contain the return value from the request or, in other words, the headlines from the Reddit homepage.

Now let's look at the templating script block:
<script type="text/os-template" require="reddit">

<ul>
<li repeat="${reddit.content.query.results.a}">
<a href="${Cur.href}">${Cur.content}</a>
</li>
</ul>
</script>
This is the block that will define the template for displaying our results. To define a templating script block, we define the type to be "text/os-template" and then we can include the object (in our case from the data pipelining request) that we want to make available to the template - we set this to "reddit" - the same value that we set as the key of the data pipelining request.

Now we can simply define the HTML that we want to use, with the variables, to display our results. For this simple use case we'll simply create an unordered list with all of the headlines displayed as anchor tag links. In OpenSocial templating, we can insert the value from a data source by including the variable that we want to act upon, displaying it in the format ${VARIABLE}. For instance, in our data pipe if we defined our key to be "foo" and in the foo object we have a sub-element named "bar", we could display it using ${foo.bar}. Another aspect about templating that we're going to be taking advantage of is repeaters. This will allow us to repeat a block of code for each object available, and is done so by adding a repeat="${OBJECT}" attribute on the block that should be repeated, in this case the <li> tag. This will create a list item for each headline we encounter.

Now, if we look at the HTML block knowing this, we can see that we are creating a root unordered list node, then creating a list item for each headline we encounter in the Reddit headlines object. The headlines are embedded in the object at reddit.content.query.results.a. Within each list item we display an anchor tag. The href of the anchor is set to that of the headline link and the text of the link is set to the headline that we get back from the query.

Once the gadget has rendered you should be presented with a very unstyled unordered list, which you may then apply CSS on to. Using this type of setup with a service like YQL, data pipelining, and templating, you can create gadgets that render very dynamic content while reducing the amount of coding that is needed.

Jonathan LeBlanc
Jonathan LeBlanc ()
Jonathan LeBlanc is a principal developer evangelist with X.commerce. Jonathan has been a member of the OpenSocial community for over three years and is the author of O'Reilly's "Programming Social Applications".