Wednesday, May 7, 2008

Local OpenSocial Development and Testing with Happyhour

For quite a while I've been working with Google OpenSocial on both Orkut and MySpace. Development is a little tedious because you always have to upload your code changes and then refresh the OpenSocial gadget in the container (MySpace for example) to try it out. Yesterday Justin mentioned something interesting in a posting on the OpenSocial group. It's called Happyhour and it's an OpenSocial container implemented in JavaScript and Google Gears. It implements the 0.7 OpenSocial specs. You don't need any server and can locally test your OpenSocial gadgets, which is really nifty!
Here's a short video chat with it's creator, Chandra Patni:



So how do you get it to work? Easy:

  1. Go to Google Gears and install it.

  2. Go to Happyhour and download the latest release and unpack it.

  3. Now open the index.html and you'll be greeted with this screen:


So you see that the user John Doe with the ID 1 has 4 friends. In the top bar you can set the viewer and owner ID, the Widget URI and the view, profile or canvas (among other things).

Now you're set up to test your OpenSocial app locally! You need to have the application available locally (or on the same machine Happyhour is hosted on). So I went ahead and downloaded my OpenSocial sample application (you'll have to check it out via SVN).

I set the owner and viewer IDs to 2, 3, 4, and 5 and set the color to red three times and once to blue:


Then I went back to viewer and owner ID 1. Behold the result:


So it really works beautifully! I'm surprised this great tool slipped under my radar for so long.
Please tell me how you use Happyhour and what caveats and workarounds you've found.

4 comments:

ronald said...

Thanks, very useful!

Anonymous said...

Great! It's that I was searching for!!
Thanks

Anonymous said...

Very interesting. I was trying to get Shindig setup on Ubuntu but without any luck, this might work for me also! Thank you very much!

Adrian

Johannes Fahrenkrug said...

I'm glad it was helpful to you, Adrian. Thanks for your comment.