Installing php Shinding

Shindig is the open source implementation of both the opensocial spec and the gadgets spec.

Using cPanel I first created a subdomain of robubu.com called shindig.robubu.com. This seems to be necessary as a lot of the code seems to assume it is running in the root web directory. It also provides a security layer as the widget gets run in the context of shindig.robubu.com and therefore can’t access cookies, dom etc. delivered from robubu.com.

Then on my local machine I exported the svn head of shindig and uploaded it to robubu.

mkdir ~/src/shindig
cd ~/src/shindig
svn export http://svn.apache.org/repos/asf/incubator/shindig/trunk/
cd trunk
scp -r . admin@robubu.com:public_html/shindig

and that was it. It’s important to note that the subdomain’s root web directory is mapped to public_html/shindig/php.

Then to use it with an embedded gadget, I included the following code in the html head.


<link rel="stylesheet" href="http://shindig.robubu.com/gadgets/files/container/gadgets.css">
<script type="text/javascript" src="http://shindig.robubu.com/gadgets/js/rpc.js?c=1&amp;debug=1"></script>
<script type="text/javascript" src="http://shindig.robubu.com/gadgets/files/container/cookies.js"></script>
<script type="text/javascript" src="http://shindig.robubu.com/gadgets/files/container/util.js"></script>
<script type="text/javascript" src="http://shindig.robubu.com/gadgets/files/container/gadgets.js"></script>
<script type="text/javascript" src="http://shindig.robubu.com/gadgets/files/container/cookiebaseduserprefstore.js"></script>
<script type="text/javascript">
var specUrl0 = 'http://www.labpixies.com/campaigns/todo/todo.xml';


function renderGadgets() {
  var gadget0 = gadgets.container.createGadget({specUrl: specUrl0});
  gadget0.setServerBase("http://shindig.robubu.com/gadgets/");
  gadgets.container.addGadget(gadget0);
  gadgets.container.layoutManager.setGadgetChromeIds(
      ['gadget-chrome-x']);
  gadgets.container.renderGadget(gadget0);
};
</script>

Added an onLoad="renderGadgets()" to the html body and then added this DIV tag <div id="gadget-chrome-x" class="gadgets-gadget-chrome"></div> for where I wanted the Gadget to appear.

The “todo” gadget, rendered through the local shindig gadget container, shows up below if you are reading this on my blog. During testing very few of the widgets available through google managed to work, but the sample ones are working. I have no idea why this is, suggestions welcome.