Tracking the new standard in social networking application development

Creating an OpenSocial application - Example 1: Mini Google Search

November 6th, 2007 Posted in Uncategorized

Fumbling together some basic code, I can now say that I have developed an application in OpenSocial: “Mini Google Search”.

Really, given that the application doesn’t rely on any friend information or any data on the social graph whatsoever, I’m not about to win an OpenSocial programming award, but it was an interesting exercise that gave me an opportunity to explore the testing environment Google has made available to developers through its social networking site, Orkut.

Application: Mini Google Search

I was interested in making a small application that allowed users to conduct a Google search without having to leave their social networking account.

Method: Pull apart some other applications to see how they worked

I went and checked out the applications at opensocialdirectory.org, as that site allows you to inspect some of the listed applications’ code.

Once I got an idea of some basic calls, I felt I was ready to proceed. It was time to hit the Orkut Sandbox.

Note: if you’d like to hit the Orkut sandbox, you’re going to need a specially whitelisted Orkut account, and you might have to wait a while for your invitation… 

Discovering the Orkut Sandbox

In programming, ’sandboxes’ are areas where you can play with technology without the risk of breaking anything valuable. Google has setup a sandbox for OpenSocial application devlopment within their social networking site, Orkut.

Within a few hours of developers being granted access to the Orkut Sandbox, it was discovered that applications that relied on ‘friends’ for testing were difficult to test because hardly anyone had any friends on Orkut, and you can’t just test your app using any friends, you can only test it using whitelisted friends (ie. other developers).

So using the Google OpenSocial group, a bunch of us agreed to add other developers as friends for OpenSocial testing purposes. At last count I have 52 ‘friends’ on Orkut. I haven’t met any of them, but I kind of wonder if I will actually get to know one or two of these guys over time (and yes, they are ALL guys).

So what did you bring to the Sandbox, Tim?

To make the application I needed to create three files:

  • An XML file to tell Orkut a little about my application (for example the application name, thumbnail image etc) - minigooglesearch.xml;
  • An HTML file that held the Google Search page (which I compiled from Google AJAX Search API) -  minigooglesearch.html; and,
  • A thumbnail image (to give the application an Icon in social network directories) -  minigooglesearch.jpg.

FILE ONE: minigooglesearch.xml
The XML file is only fairly small - have a look at it if you like.

Looking at the XML file, even a non-programmer could find themselves renaming the application and making themselves the author in no time at all!

FILE TWO: minigooglesearch.html

Now, the HTML file required was provided almost entirely from Google - it was presented to me when I signed up for their AJAX Search API as a ’starting point’.

So I took their starting point and made a few tweaks - mainly that I set the page to automatically load with the results for the search: “site:opensocialblog.com” - I thought I’d give the blog a plug! You can go straight to the search page file to see how it looks.

FILE THREE: minigooglesearch.jpg

A lot of the guys developing apps in Orkut’s sandpit aren’t bothering to create thumbnails at this stage, but it only takes a minute, so here’s what I knocked up:

Mini Google Search

So with all three files together, I uploaded them to my server (opensocialblog.com/applications/minigooglesearch/) and hit the sandbox…

Orkut’s Sandbox is full of broken toys, in fact, Orkut’s sandbox often IS a broken toy…

“Bad, bad server, no donut for you” - that’s not me cursing Orkut, that’s Orkut’s error message - it’s Orkut chastising itself.  Well, if you’ve been testing your application in Orkut, in the past few days, you’ve seen that message a lot.

So, on to testing “Mini Google Search”

It didn’t take too many goes to have Mini Google Search running like a proper social network application.

Here are two screenshots:

Screen Shot One: A list of my Orkut applications - at the time of the screenshot, I only had Mini Google Search installed.

Mini Google Search 1

Screen Shot Two: A look at my profile, complete with Mini Google Search

Mini Google Search 2

 Sharing the application so everyone can see how it works

My next step was to make the application publicly available. If you have a whitelisted Orkut account, you can install the application using this URL:
http://www.opensocialblog.com/applications/minigooglesearch/minigooglesearch.xml

I have also shared the application at opensocialdirectory.org

Thanks

Thanks to anyone who is taking time to answer questions at the OpenSocial Google Group. Forums are at their best when answers are swift and friendly.

…And speaking of swift and friendly, I have to send a big thank you to Chester Millsock - I had a question about his blog post and he came back with a helpful, detailed reply in no time at all.

  1. 4 Responses to “Creating an OpenSocial application - Example 1: Mini Google Search”

  2. By CJ Millisock on Nov 6, 2007

    It was my pleasure to be of assistance!

  3. By victor on Nov 6, 2007

    Great and so simple ! :)

  4. By melvster on Nov 6, 2007

    Very good tutorial, thanks!

  5. By Arnav on May 16, 2008

    I have a gallery2 embedded into my wordpress blog. I wish just like FACEBOOK, there was an application on ORKUT that could allow you to import gallery2 images into orkut albums…. all programmers out there… this must be a piece of cake 4 u… please please please tell me ur on it….. !!!

Post a Comment

Open Social is Google's attempt to become the centre of social networking. The program's launch partners constitute top social networking application developers and 2nd tier social networking hosts.