Google Homepage API

Yesterday, I sat down and played around with the new Google Homepage API, which is interesting, in and of itself. I found the development to be most like developing a widget (for Dashboard or Konfabulator).

A couple observations:

  • By default, your module is contained within a fixed height IFrame, but it’s possible to actually embed your widget straight into the Google Homepage itself.
  • My first worry was over the possibility of XSS attacks, but all modules run on a different domain, gmodules.com. (I’m not sure what happens if you embed it in the page, my guess is that they’re far more restrictive, if you want your module to run free like that)
  • The have a server-side proxy that’s on the same domain as the modules – which means that you can do cross-domain XMLHttpRequests – a very smart move (at least from a developers perspective, not sure about security, though).

My first test module is rather simple, it’s just the current list of links from del.icio.us popular, auto-updating every hour. To run it for yourself, go to your Google Homepage, click the ‘Add Content’ link and enter the following URL into the ‘Create A Section’ textfield:
https://johnresig.com/apps/igdel/
If you’re worried about running foreign modules on your homepage, you can feel free to look at the source code – it’s completely harmless.

The majority of the code, for the frontend of the module, was borrowed from two places:

The final bit, that made this module work, I’ll discuss tomorrow – it’s a dynamic RSS to JSON convertor, that’s incredibly cool. (If you’re feeling adventurous, you can look at the module source code and find it hidden in there.)

Posted: December 14th, 2005


Subscribe for email updates

11 Comments (Show Comments)



Comments are closed.
Comments are automatically turned off two weeks after the original post. If you have a question concerning the content of this post, please feel free to contact me.


Secrets of the JavaScript Ninja

Secrets of the JS Ninja

Secret techniques of top JavaScript programmers. Published by Manning.

John Resig Twitter Updates

@jeresig / Mastodon

Infrequent, short, updates and links.