Adding Google Wave to your blog

Google Wave
Oct
18

Google Wave is the new sensational communication and collaboration tool that has recently been released in limited numbers to the public. In this article we take a look at how you'll be able to use Google Wave on your own blog and how to use the various APIs that are available.

To start with let us take a look at the method for embedding Waves on your own website. The idea I've had is that when it's opened up to all I'll be able to replace my comments system with a Wave (hopefully will be able to protect it from spam using my current solution) and as a support system for NEO products such as Linnaeus for the iPhone.

An embedded wave acts and behaves the same as a wave within the Google Wave application. An embedded wave even supports drag-and-drop functionality, allowing you to provide your users with a truly interactive collaboration tool.

Before you can embed a Wave on a page you will need to ensure it is including the appropriate JavaScript file, so you will need to add:

<script src="http://wave-api.appspot.com/public/embed.js" type="text/javascript"></script>

By including this file it will use 12Kb of bandwidth without actually having loaded the contents of the Wave as it will in turn download styles, images, and eventually the content. The approximate value of 12Kb comes from it having loaded the error page when I tried to use it initially. This on it's own won't do anything though, you will also want some sort of placeholder that you can use for populating with the contents of the Wave. In this case I've simply created a div element called support_wave.

<div id="wave_container"></div>

Once the page has loaded we'll then have the div element available to use to add content to, so to the windows load event we want to add a call to the following function:

function initialize()
{
  var wavePanel = new WavePanel("http://wave.google.com/wave/");
  wavePanel.loadWave("googlewave.com!w+waveID");
  wavePanel.init(document.getElementById('wave_container'));
}

This function will initialise the variable wavePanel as a new WavePanel object and will load the contents of the specified Wave by replacing waveID with ID of the Wave you want to be displayed. Once it has loaded it will then take a DOM object as a variable to initialise the Wave panel. Since the sandbox was opened up the only way I know to get the waveID is to add embeddy@appspot.com to your Wave as it will include the WaveID or to look at the URL which ends in w%252B followed by the WaveID.

At this point the Wave is now embedded on your page, but as you can see from the Google Wave Embed API there are other things you can still do with it. One such thing you can achieve is that if the current viewer is logged in to Google Wave you can use the addParticipant() function to add them to the conversation automatically. You can also use the WavePanel.UIConfig object to change the look and feel of the embedded Wave to better suit your site. You might for example want to change the background colour, which you could do using the following code before the wavePanel.init function is called.

setUIConfig('blue', 'white', 'Georgia', '12pt');

This example uses a member function of the WavePanel class instead of using the UIConfig and uses the parameters in the order of background colour, text colour, font and font size (measure in points or pixels only). Alternatively you could try something along the lines of:

var myConfig = new WavePanel.UIConfig();
myConfig.setHeaderEnabled(false);
myConfig.setFooterEnabled(false);
myConfig.setBgcolor('blue');
myConfig.setColor('white');
myConfig.setFont('Georgia');
myConfig.setFontSize('12pt');
setUIConfigObject(myConfig);

This will use the UIConfig object instead and will then assign it to the WavePanel object. You will notice using this method allows you to also remove the header and footer from the Wave, but there are also a number of get functions that can be used to obtain the existing values for these properties.

your comments - Post a comment

david sanger

so where have you embedded a wave in your blog?

david sanger commented 5 months ago
David G. Paul

It's not on my blog yet, only on a test page as the API usage still seems to be in the sandbox

http://www.newearthonline.co.uk/products/linnaeus/support

David G. Paul commented 4 months ago
ben koonse

cool post i really want to try development for wave, do you know how to get an invite?

ben koonse commented 4 months ago
David G. Paul

Although you can sign up for an invite at wave.google.com I think most people have been getting in by receiving invites from existing users.

Unfortunately I'm now out of invites (limited to 20 per account).

David G. Paul commented 4 months ago
kk

i have a developer access for google wave
i have embedded wave in my site.
but i want to show toolbar containing playback reply..
please help

kk commented 4 months ago
David G. Paul

Hi kk,

I'm afraid at the minute the only way to use the playback functionality is via wave.google.com - they have not yet added this to the Embed API.

David G. Paul commented 4 months ago
ben koonse

hey kk, what is the url of your site, I would like to check it out

ben koonse commented 4 months ago
Niall

You don't have to use embeddy to get the wave id.
If you click on a wave in google wave and inspect the URL that you're at it might end with something like...
https://wave.google.com/wave/#minimized:contact,restored:wave:googlewave.com!w%252B(ID_NUMBER_CAN_BE_FOUND_HERE).1

Niall commented 4 months ago
blog comments powered by Disqus