skip to main | skip to sidebar

19 October 2009

Add Google Wave In Your Web/Blog Site

Just this early morning, I have received an Google Wave invitation from my co-worker and checked it out immediately, watched the looooooong video from Google Wave and all I can say everytime they showed something was “whoa!”

So embedding Google Wave object into a web site got me something to work on. Got some disappointments due to some feature were no longer working and some of it was just uhh.. ok. Then I crossed into a site which brings back my energy.

Thanks to @Mark Essel and his How To Embed Google Wave on Your Wordpress Blog just for Wordpress. Since am using Blogger I thought it was a bit of .. different approach .. approach that it could be use in any web site.

Anyway! here’s how to embed google wave in your web site.

First thing to do, you have to know what your Wave ID is .. to easily help you with that… add embeddy@appspot.com to your contacts

Now once you created a New Wave and added Mr Embeddy to partcipate in your Wave, you’ll notice it will automatically add something like this

Something like the image below But what you really need is this .. The WaveID
image image

Copy that somewhere, or paste it in the Notepad.

Now you can safely remove Mr Embeddy and add public@a.gwave.com so you can make your Google Wave viewable in public. But unfortunately, only the Preview and Sandbox account can view the Wave (FOR NOW). There are some issues regarding to public@a.gwave.com you can read it here Google Wave 101.

So if you have all those setuped now.. then the real deal starts.

Adding Javascript in your website

It’s small and easy. Just add this Javascript

<script src='http://wave-api.appspot.com/public/embed.js' type='text/javascript'></script>
<script type='text/javascript'>
/*
Embed Google Wave Script v2.0
Re-writen by: Jayson Ragasa, Baguio City, Phillipines

Original Version (V1.0) from Mr Embeddy: embeddy@appspot.com
*/
var div = document.getElementsByTagName('div');
/*
If you're going to use this script in Blogger, make sure the "<" (lesser-than) sign in "for (var i = 0; i < div.length; i++)"
is converted to &lt;
*/
for (var i = 0; i < div.length; i++) {
if( div[i].id.substr(0, 5) == 'wave_' ) {
var id = div[i].id.substr(5, div[i].id.length-5);

var wave = new WavePanel('https://wave.google.com/wave/');
wave.setUIConfig('white', 'black', 'Arial', '13px');
wave.loadWave('googlewave.com!w+' + id);
wave.init(document.getElementById(div[i].id));
}
}
</script>

for blogger users. Get it here http://pastebin.com/f6894ebaa

and INSERT IT BEFORE the </body> tag

and if you want to start embedding a (Multiple) Google Wave object in your Website, Blog Post, or Gtalk ( huh!? ;) view only though .. )

add this small HTML tag called DIV in your POST page.

<div id="wave_<waveid>" style="width: 560px; height: 420px"></div>

e.g. the WaveID is G00gl3Wav3

<div id="wave_G00gl3Wav3" style="width: 560px; height: 420px"></div>

and you’re ready to Publish!

Give it a try and don’t forget your feedback!

Cheers!

38 comments:

  1. Cool beans Jayson. May use this on my other sites thanks for sharing the script. Rock on!

  2. @VictusFate

    thanks!

  3. hello, thank you for your code...
    i am experiencing a little bug with it in blogger, when i try to save my html code i've got this XML error message: "The content of elements must consist of well-formed character data or markup."

    help needed please. ;-)

  4. @Jips.jpeg check the script comment :D

    /*
    If you're going to use this script in Blogger, make sure the "<" (lesser-than) sign
    is converted to <
    */

  5. /*
    If you're going to use this script in Blogger, make sure the "<" (lesser-than) sign
    is converted to <
    */

    how can i do this? i have to copy "<" instead of "<" in the code before pasting it in my template?
    i did it but it's the same...

  6. @Jips.jpeg

    sorry

    "& l t ;" (no spaces and double quote.)

  7. Google Chrome said your site was unsafe.

  8. My blog site contains Malware!?! c'mon Google! Please no!

  9. Hmm... could quite get it. Only time it worked was between the Header and Body of my template, and then it took over the entire blog. Never got it to show in a post. Perhaps it doesn't work on all templates (mine has left-hand columns)?

    Like the approach though... thanks. I'm going to try it on Wordpress.

  10. Hi, me again-

    Works in WordPress like a charm, in case you are still wondering. Inserted it directly in a page and a post, and it worked great. (The div line must be first, before the javascript, you might want to mention that in the instructions).

    Still no luck with blogspot though. I'll try and mess with it later.

  11. @AdamRothstein

    thanks for using my code. anyways, I think I put an instruction to put the javascript before the "< / body >" tag and the DIV tags must be in a POST (am not sure how to call it in wordpress)

    let me just update this post.

  12. I try to use your code on My blog (blogger) but when I publish my new message with the code on the blog they are ... nothing ... just a blank space with the frame sizes! (I'm french so my english is ... beautiful lol)

  13. @Florian aka Spike

    no problem.. :)

    you sure you got teh correct WaveID?

  14. So I'm trying to embed this in my standard run of the mill website. I'm placing it as the sole object on my home page and followed your instructions. I'm curious where I should paste the html tag with the wave id since I don't have a "post" section. Thoughts?

    Thanks,

  15. @BJ

    just place it anywhere inside the BODY tag.. in your main content probably..

    should work :)

  16. Thanks! You rock!

  17. hi glad I found your blog. I tried the embeddy feature and that other one on wave but is that code that I'm supposed to put before < /body > is wrong, but it wasn't as long as yours.. Have u seen it? anyway I tried to embed two posts next to each other with public waves and I was able to embed but when I looked at my main site, they overlapped my posts and it looked weird. I did not put any code before body... http://www.newsbysector.com, http://www.newsbysector.com/2009/11/am-i-embedding-google-wave-wrong-it.html, http://www.newsbysector.com/2009/11/google-wave-embeddy-madoqua-test-visit.html. Thanks though I'll try to mess w/ it.

  18. I got the same xml error when I changed the < to <! Did @Jips ever work that out?

  19. @dvolatility

    the "<" am talking about was the one inside the for(){...} loop

  20. change the "<" in "for (var i = 0; i < div.length; i++)" that code to "& l t ;" (no spaces)

  21. sux I still get this!

    "Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
    XML error message: The content of elements must consist of well-formed character data or markup."

  22. @newsbysector

    the javascript code looks for a specific wave id in DIV ID attribute so it should be before the < /body > tag.

    anyway, try to mess with it and about that overlapping problem .. am not sure about that problem though check your CSS too.

  23. @dvolatility

    ok try removing the JS code I gave and check if you still getting the error.

    if you do, there's something wrong in your template.

    if you successfully saved the template put the JS code back. Get it here http://pastebin.com/f6894ebaa

  24. ok thanks very much

  25. oh that one saved from the link you provided!

  26. Yes! Thank you sir.

  27. you rock!


    thanks, from portugal.

    http://naovenhastarde.blogspot.com/

  28. I got it to work without error per say... but it just displays an image saying "Watch our loooong video" and a preview image of Google Wave. Am I missing something obvious? http://bradswebplayground.blogspot.com

  29. http://velociraptoronzebra.blogspot.com/2009/11/gfhsfghsgf.html

    it kinda works but not really falls to the bottom of the page

  30. hi your codes works great except as soon as i log out of my googlewave account the blog stops displaying. i have got public@a.gwave.com assigned to the wave any ideas

  31. Hello guys!

    I recived my google wave invite recently this morning, and was excited to try it out on websites ect.

    Unforntunatly public@a.gwave.com does not seem to have a google wave account =(

    http://img694.imageshack.us/img694/7987/googlewavepublicagwave.jpg

  32. hi Henrik

    if you just hit return and ignore the error message it will add public@a.gwave.com to you contacts - slight bug in the matrix :-)

    cheers

    liz

  33. This comment has been removed by the author.
  34. *completely lost, new to wave and scripts*
    How do I get the WaveId? I have missed something just after the firts step :(

  35. If I want to share pictures from wave to blog, how to do that

  36. I have it working in blogger, sort of. However the Wave only shows in a box and this is not big enough. It also does not extend when I add to the Wave, so it only seems to be showing a little snapshot.

    Please help

  37. I got this to work, but I could not remove the content in the wave inserted by embeddy ... the Delete option was grayed out. It would let me use Edit mode, but wouldn't let me do anything in it.

    I also noted that the wave id was in the URL. Any reason for not using that instead?

  38. Hi again Nullstring, I have a problem and thought you might know what happened. I uploaded an updated Disqus comment system to sync with Blogger, now however, the embedded wave duplicates and overlaps with the top of the comment system. Do you have any idea why this happens?? I might have to delete it for the time being since it doesn't look good. Thanks for your help.

    http://www.distressedvolatility.com/2009/12/public-drys-chart-updates-on-google.html