Running is therapy

Running, hacking and being awesome.
  • Home
  • Current Schedule
  • Personal Records

more on google widgets

Published by Nathan Powell on December 17, 2005 09:46 am under programming

If you are new to web programming I urge you to take a look at the widget documentation for the google widgets. I think the instant gratification of seeing these things in action will keep your interest high. I also think that there is an opportunity for you to release code (as google allows you to submit modules for others to use).

Even if you don’t have access to a publicly available web server, they have space for you to upload your modules. In addition, one of the cool things you can do is to use the content type ‘url’. Effectively this would allow you to write a little bit of code (in whatever web enabled language you’d like) and put the result into a widget. Below is my no nonsense guide to getting started :)

The module:

< ?xml version="1.0" encoding="UTF-8" ?>




Then the backend code (and feel free to use whatever web enabled language you like here, I am mearly using perl for the heck of it). Make sure that this file is named and located according to the url you put in the content type above. In our case we would name this file wonderModule.pl and it would be located in the $DOC_ROOT/cgi-bin/ directory of our publicly available webserver.

#!/usr/bin/perl -wT
use strict;
use CGI;

my $q = new CGI;
print $q->header();
print "Hello World!";

Then using the Developer Module from Google, add the url to the XML file (note, the XML file, not the cgi script)

Lastly refresh the Google personal homepage (as I have read elsewhere and experienced myself, if you uncheck the ‘cached’ box on the developer widget, it really only works about half the time. So if you have made a change to the file but it is not showing up, hit refresh a few times and it will come around). Our example would show up like so:

There is of course way more you can do then that, however that will get you up and running. Then using JavaScript and whatever language you use to generate the content for the url means there are very few boundries to what you can make your particualr widget do.

Happy hacking!

1 Comment so far

  1. import this. » Blog Archive » Google widgets on December 19th, 2005

    [...] Nate explains how to make a Google widget. Cool stuff. [...]

Posting your comment.

  • Search

  • Archives

    • February 2010 (1)
    • January 2010 (1)
    • December 2009 (2)
    • September 2009 (2)
    • August 2009 (4)
    • July 2009 (4)
    • June 2009 (2)
    • May 2009 (3)
    • April 2009 (1)
    • March 2009 (3)
    • February 2009 (5)
    • January 2009 (4)
    • December 2008 (5)
    • November 2008 (2)
    • October 2008 (10)
    • September 2008 (4)
    • August 2008 (10)
    • July 2008 (11)
    • June 2008 (14)
    • May 2008 (15)
    • April 2008 (10)
    • March 2008 (16)
    • February 2008 (17)
    • January 2008 (37)
    • December 2007 (21)
    • November 2007 (30)
    • October 2007 (29)
    • September 2007 (22)
    • August 2007 (30)
    • July 2007 (49)
    • June 2007 (32)
    • May 2007 (29)
    • April 2007 (38)
    • March 2007 (26)
    • February 2007 (25)
    • January 2007 (23)
    • December 2006 (10)
    • November 2006 (12)
    • October 2006 (9)
    • September 2006 (9)
    • August 2006 (5)
    • July 2006 (13)
    • June 2006 (9)
    • May 2006 (8)
    • April 2006 (11)
    • March 2006 (12)
    • February 2006 (12)
    • January 2006 (13)
    • December 2005 (15)
    • November 2005 (19)
    • October 2005 (8)
  • Categories

    • blather (70)
    • books (10)
    • computers (179)
    • cooking (1)
    • economics (3)
    • emacs (3)
    • football (1)
    • gaming (1)
    • hiking (5)
    • housekeeping (5)
    • lifehacking (7)
    • music (3)
    • paddling (2)
    • personal (1)
    • politics (21)
    • programming (77)
    • running (257)
    • smoking (41)
    • sysadmin (13)
    • tlc (10)
    • Uncategorized (1)
  • Pages

    • Current Schedule
    • Personal Records

Copyright © 2010 Running is therapy
WordPress Theme based on Light Theme