Swaylock's Google Gadget

For those of you who have waiting (seemingly forever?) for a Swaylock’s Google Gadget to dress up your iGoogle page… your wait is over,… okay, but at least the end is in site.

What’s a Google Gadget, well if you use iGoogle, then the picture below says it all.

Now I could publish it, but my guess is that many of you will want to mutilate it, or add your own ‘thing’. Say a ‘Dynamic tunnel fin’ or say, somebody from FoamEZ might want to put their FoamEZ logo on it, with some additional retail information, which could change dynamically (…talk to your webmasters, make them earn their keep…talking to me will get you no where unless money is involved… yes I’m a ho, too… another reason to trash my posts.) Or maybe you might wish to do your own personalization. (Come to think of it, maybe a ‘vortex fin’ might work here.) Then once you’re convinced that it’s ready for prime-time you can publish at Google, or at your site, or ask Swaylock to fork over some new i-real-estate for a gallery of Swaylock gadgets.

But you don’t have to stop with a Swaylock gadget, heck, you can pump out loads of icrap for inclusion into your iGoogle homepage, e.g. dynamic video of your favorite break, your favorite goat(?), etc. all together with your new handy dandy Swaylock’s gadget.

Can you die now that you’ve got a Swaylock’s gadget? Well, if you’re ready to go, please consider one last act of altruism and sign up for the olo test at the Pipe – you’ll be immortalized on YouTube and of course in the Swaylock archives.

So, here’s some code to get you started.

Google Gadgets DocumentationJust go to , scroll down to the niffty editor, insert the code below and start making a mess.

kc

<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Swaylock's Forum" height="250" scrolling='true' />
<Content type="html">
<![CDATA[
<div id="content_div"></div>
<script type="text/javascript">
function _callback_func(responseText) {
    if (responseText == null) return;
    var html = "<div>";
    html = responseText.replace(/--start--/,"");
    html = html.replace(/--end--/,"");
    html = html.replace(/<a/gi,"<a target='_blank'");
    html = html.replace(/[/]forum/gi, "http://www.swaylocks.com/forum");
    html += "</div>";
   _gel('content_div').innerHTML = html;
   }
   var url='http://www.swaylocks.com/forum/gforum.cgi?do=search_results&search_time=1h&t=homepage';
    _IG_FetchContent(url, _callback_func, 1200);
</script>
]]>
</Content>
</Module>

great idea! i just tried to copy and paste the code into the GGE but didn’t seem to work…

am i missing something?

My apologies, it was a rough week.

Two errors, one critical, one minor.

[indent]

  1. Semicolons: javascript statements end with semicolons,
var url='http://www.swaylocks.com/forum/gforum.cgi?do=search_results&search_time=1h&t=homepage'

was replaced with

var url='http://www.swaylocks.com/forum/gforum.cgi?do=search_results&search_time=1h&t=homepage';
  1. Variables: it’s always nice to get them right
html = responseText.replace(/--end--/,""); 

was replaced with

html = html.replace(/--end--/,"");

[/indent]

Number 1 was a critical error. Number 2 was not.

I’ve made the corrections in the code, and tested it.

The code is not perfect, code rarely ever is. I have assumed that once someone gets it up and running that they will make their own mods.

kc

Thanks Kevin

a handy gadget, particularly in work, keeps teh web stats down as it all just shows up as google.

I found I had to bring the google editor and Kevins posts up in two windows and re size them so they are side by side on the screen. Then make sure it shows in the editor exactly as Kevin has it.

Then SAVE by clicking on the word File.

Then PUBLISH from the file menu.

You can do a lot with gadgets. If you add some tabs, you can capture surf cams, forecasts, etc… all in the one surf related gadget. I have mine reach out of the screen every 5 minutes or so and slap me… what’s the saying ‘…an idiot keeps doing the same thing but expects different results’?

kc

PS

If you’re concerned about ‘stats’, consider leaving out the line

html = html.replace(/<a/gi,"<a target='_blank'");

Then when you click the hyperlink to a thread, the whole forum page should appear in the gadget… disturbing, huh?.. this going to allow for all sorts of personal ‘porn’ viewing (whatever your personal porn might be) in corporations worldwide. Google may have opened up a real can of worms. It will be curious to see how fast Corporate World catches on.