4
Jun
written by admin • posted in How-To • 1,048 views • 11 comments
wp_add_faux_ml( 'gwave', 'wp_gwave_faux_ml' );
function wp_gwave_faux_ml( $src ) {
$srctag = str_replace("-","a",substr($src,18,8));
$obj = '<script src="http://wave-api.appspot.com/public/embed.js" type="text/javascript"></script><script type="text/javascript">function initialize'.$srctag.'() { var wavePanel = new WavePanel("http://wave.google.com/a/wavesandbox.com/"); wavePanel.loadWave("'.$src.'"); wavePanel.init(document.getElementById("waveframe'.$srctag.'")); }</script><div id="waveframe'.$srctag.'" style="width: 600px; height: 80%"></div><script type="text/javascript">initialize'.$srctag.'();</script>
';
return $obj;
}
I am using the API in the original fauxML plugin. By adding the code above to the php code, fauxML now supports the Wave insertion by the following syntax:
![]()
Remember to add onload=”initialize()” to the body tag. Something like:
<body onload="initialize()">
There are ways to trigger initialize() using other methods, one example is here. I can change my body, so I go with the easiest way. I saw this post and decide to put
<script type="text/javascript">initialize();</script>
right after the div#waveframe! Better code. No longer to tweak the body header.
Right now, I can see this (below is a screen capture, not the real wave)

only in Chrome 3, not Firefox 3.5b4 or Safari 4beta. Emm emm ……
Detailed information about the Wave Embed API is here. Enjoy waving!
11 Responses to “A quick way to embed Google Wave into blog powered by wordpress”
Leave a Reply
blog by cail
- » Buy Chinese Painting
- » a page for 99life, fdu
- » 2shRNA - design oligos for RNAi
- » Feed collection of leading biology journals
- » How to use ImageJ to analyze images?
- » Play background music
- » About CaiLog
New in 'How-To'
- http://pubmeder.appspot.com/ open to public
- PubMed-er : ease your paper reading in browser
- Use vUSBbus to backup and emulate Sentinel and HASP dongles (HASP3/HASP4/Hasp HL USB keys) #getkey
- Install Snow Leopard on EeePC 1000HA (for Google Contact Sync with photo)
- How to setup Exchange ActiveSync account on #htc #evo 4G (should work for other #android phone with HTC Sense)
- Sprint HTC #evo running on Verizon network … and speed comparison
- HTC #evo: #root from @toastcfh, RUU stocks, OTA update and @unrevoked
Hot in 'How-To'
- analog – analog/digital – digital, VGA – DVI – HDMI - 26,386 views
- Ez-12 windsurfer antenna - 14,546 views
- How to add new ringtones to iPhone - 12,326 views
- Air Video, video stream and live convert your favorites to iPod Touch, iPhone and iPad (How to setup the server for Ubuntu and OpenSolaris) - 9,504 views
- mac osx 10.5.1 kalway on Lenovo Thinkpad T43 2668AJU - 8,399 views


at the current stage, to view the embeded wave, you need to have a wave account. and the embed only works for Chrome.
[...] from Google Wave using my modified fauxML plugin. And here is the content (you need a wave account and see it in Chrome [...]
Firefox 3.0 with Google Gears 0.5.21.0 works!
Since “-” is not allowed in some part of the JS code, I modified my php script a little to replace “-” with “a”.
Hello! I created a WordPress plugin that is similar to this, but gives you all the options of the Wave embed API, plus a button in case you forget the shortcode. My solution also takes advantage of WordPress’ inbuilt shortcode API, so having fauxML is not necessary the functionality is built into WordPress. The code is located at http://code.google.com/p/wp-wave-shortcodes/ .. it’s still a bit messy internally, but it is worth looking at… Especially if you have a Wave account already! (I don’t have one, so all I see is the “We’re in a preview” message…)
Hi Joshua, I test your plugin – somehow it is not displaying.
I saw the [wave id="wavesandbox.com!w+MkAgF3zH%1"] was convert into a wrong id … wavePanel1.loadWave(‘wavesandbox.com!w+0′);…

I was also playing with multiple waves in one post by using some str_replace; should work, but not – probably due to the buggy wave system in the current state.
oops, Joshua, I check your code and see “loadWave(‘wavesandbox.com!w+< ?php print $wave_id; ?>‘);”
so I test with [wave id="MkAgF3zH%1"], but same output wrong id is displayed
I think it might be a good idea NOT to hard code wavesandbox.com!w+ because other wave servers will have different prefix …
Hey there, yet another plugin for wordpress, Wavr, using shortcodes like you use, you can set all available options in the shortcode and it has a settings page where you can set your defaults. I hope you like it! http://wordpress.org/extend/plugins/wavr/
cool, thanks Lucas
[...] am a blogger, and I want to embed Wave easily into my blog post. Here is how. Of course, there are many solutions on the Internet which are doing the similar [...]
#io2010, please notice that right now, for a public wave, t login, the wave can be viewed as read-only! Nice.