Making iGoogle gadgets is fun. Really!
In my previous post, I talked about how Web 3.0 (or the next decade of the web, as I'd rather put it) is about two main things:
- A shift in context ("the context is me")
- Widgetization of content
I try my hardest to practice what I preach, but technology can be a bumpy road. Fortunately, in most cases, persistence always wins out.
I recently started a new web site called Arnold Quotes. It's simply all the best Arnold Schwarzenegger action-star-pun style quotes, all in one place. The ongoing goal of this project is to widgetize its content, and the first widget platform on my list was iGoogle.
When I first started making the iGoogle gadget for Arnold Quotes I figured it would be pretty easy, but I had some trouble. My original plan of attack was to serve up XML from arnoldquotes.com, and parse it with JavaScript inside of the iGoogle content module. I ran into a lot of difficulty, so I took another route, and served up straight HTML from arnoldquotes.com and stuck it in an iFrame. This worked OK, but it wasn't really ideal. If the gadget ever became very popular, Google wouldn't be able to cache it very well, which could really tax my server. It was also difficult to make JavaScript calls from inside the iFrame that didn't make several browsers freak out.
So I went back to my original plan, and I'm glad I did. After some stumbling, I managed to put together a native iGoogle gadget, which should run properly in all modern browsers. I was having some weird scroll bar problems with Internet Explorer 7, but I mitigated those issues by making the iGoogle gadget dynamically resize its height. The reason I had a hard time at first was because I wasn't traversing the DOM tree properly with JavaScript. After doing a little bit of reading in the rhino book (O'Reilly's "JavaScript: The Definitive Guide"), I realized what I was doing wrong, and managed to fix the problem. If you're curious, you can add the gadget to your iGoogle page by clicking here.
All said and done, I actually had a really fun time making the gadget, and I want to make more now. What gadgets would you like to see?