Introducing DAfOS: Quick OpenSocial testing

| | Comments (0) | TrackBacks (0)
When teaching myself the OpenSocial API, I found the standard "edit XML file" -> "upload to server" -> "reload gadget" process to be too slow for my liking, especially when working with code that was almost completely client-side JavaScript. 

A strength (or weakness, depending on who you ask) of JavaScript is that you can compile and execute JavaScript source code at runtime using the eval function.  It made sense to create a simple gadget to help developers prototype simple OpenSocial calls, so I released CodeRunner, an OpenSocial application that let developers execute JavaScript snippets inside of a live OpenSocial container.  These snippets could also be saved to AppData, which was convenient as long as you didn't run out of quota space (currently 10k on orkut and 1k on MySpace).

CodeRunner wound up working quite well, but I wanted more space for storage, and I wanted to offer some capabilities that only a server-side solution would be able to satisfy.  Because Google released their App Engine product around this time, I decided to turn CodeRunner into an App Engine application, called the Developer Application for OpenSocial, or DAfOS for short.

You can get links to use DAfOS on different containers by visiting dafos.appspot.com.  Eventually that site will be filled out with more documentation. 
 
Here's a shot of DAfOS in action (it looks a lot like CodeRunner at the moment):

DAfOS.png

DAfOS_execute.pngSamples are entered into the yellow input box.  You can run a sample by clicking the "Execute" button in the top right hand corner of the gadget.  The JavaScript entered in the box will execute as if it were part of the gadget itself.  That means that you can execute social data queries, post Activity Stream entries, send messages, and anything else that the OpenSocial API allows.

DAfOS also defines a method called output.  Everything you pass to this method will be printed out in an output box at the bottom of the application.  If you have Firebug installed (you really should!), then you'll see this output in Firebug's console, as well.

Picture 7.png

Since DAfOS runs on App Engine, the samples are no longer stored in AppData.  When you save a sample, it is actually hosted at dafos.appspot.com, and accessible by clicking on the name of the sample after you save it.  This URL can be sent out to help supply code for reporting issues or helping other developers with problems.

DAfOS_controls.png

Because I use DAfOS to write most of my samples, you'll be able to copy and paste most of the code snippets from this blog directly into DAfOS and watch them run.

You can still use CodeRunner by installing this gadget XML spec to a container, but there will not be any future development on it, meaning it will likely stop functioning once containers switch to OpenSocial 0.8

0 TrackBacks

Listed below are links to blogs that reference this entry: Introducing DAfOS: Quick OpenSocial testing.

TrackBack URL for this entry: http://roomanna.com/mt-tb.cgi/1

Leave a comment

About this Entry

This page contains a single entry by Arne Roomann-Kurrik published on August 20, 2008 12:38 PM.

Updating your apps to use the IdSpec object in OpenSocial 0.8 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.