Web Development
Tips for Writing a Google Gadget
1/26/2009 9:00:35 AM
Here is a quick list of tips for getting started with developing a Google Gadget:

1. Use the Google Gadget API Documentation

Originally this post was going to be a tutorial about writing a Google Gadget, but there are plenty of other tutorials around the web that you can check out. When learning to write a Gadget for work I used Google's Legacy API documents. They have at least one sample for most of the API calls. They also have a few tutorials on getting started with your own Gadget and instructions on how to publish it. Overall, it's a great resource.

2. Keep It Simple

When creating a Gadget that is simply redisplaying information from your site, make sure not to overload the Gadget with a lot of content. The goal of a Gadget is to be a quick way to get information that you care about without having to look all over the web. For example, don't create a Gadget that lists every single product that your retail website sells. If the users wanted to browse all the products on your site, they would just go to your site. You could use the Gadget to display products that are on sale or new released items.

3. Bust That Cache

This next tip is especially use for development. Google Gadgets have a nice feature of caching whatever content you had it read from the web for you. This can lead to problems when you are developing a Gadget. If for example you were modifying the content of your custom XML file to be sure that Gadget updates correctly, you may have to wait up to a minute for the content to be updated. This may not sound like a long time, but it really messes up your feedback loop. This can also be a problem if you want updates on intervals that span less than a minute. One solution I found that works well is using a cache buster.

Example Code

4. Test Test Test

This should probably go without saying, but be sure you test your Gadget in all browsers. There is a lot of Javascript going in the background of Gadgets, and you want to be sure you are using code that works in the major browsers. Another tip along this same line is to be sure you test your Gadget by adding the Gadget to your iGoogle page. To test your Gadget, use the following steps:

1) Click Add Stuff on your iGoogle Home Page
2) On the left hand column, click "Add feed or gadget".
3) Paste a public URL to your Gadget XML file. Be sure to add a query string of a random number
    if you have already added it before. Just like content Google caches Gadget files for an hour.
4) Go back to your home page, and you should see your Gadget.

That sums up all the tips I have for creating a Google Gadget. Does anyone else have any tips they would like to share?
Posted by: Ryan Farnell | Submit comment | Tell a friend

Categories: Google Gadget  |  Software Development

Share and enjoy: Del.icio.us   Facebook   Furl   Google Bookmarks   NewsVine   Reddit   SlashDot   Technorati   Windows Live Bookmark   Yahoo Bookmark
0 Comments
Submit a Comment
Name
E-mail
Web Site  (optional)
Comment
HTML tags are not allowed.

 

© Copyright 2010, Bizzuka - Blog. All rights reserved.