Reaching Google Users


One quick way to reach Google users is to write Google Gadgets that they can use on their home pages or their Google Desktops. It’s a fun and simple way to interact with others. Another simple thing you can do is to create custom buttons for the Google Toolbar. Create fun buttons that point to your home page and trade them with your friends.

Write your own Google Gadgets

You can write two types of Google Gadgets: Universal Gadgets and Desktop Gadgets. The Universal Gadget sounds like the perfect tool for any toolbox. Though it’s up to you to build one, the Universal Gadget can be plopped onto any Google Home page (http://pages.google.com), Google Desktop, Blogger blogs, or even your Web page hosted somewhere other than GooglePages.

The Desktop Gadget works with Google Desktop and can run on your desktop after you install Google Desktop. Read more about personalizing Google Desktop in Chapter 11.

Building Universal Google Gadgets is fairly simple compared to the other API technologies in this chapter. You won’t have to download anything, and there are no API libraries to learn about. You can write a Google Gadget using simple HTML, or if you want to get fancy, you can use Javascript. One downside to a Universal Gadget is that you must be online for it to work. If you need a gadget that works offline, try a Desktop Gadget.

The Desktop Gadget has a bit more flexibility. Even though it works only with Google Desktop, it runs even when you are not connected to the Internet. Google Desktop Gadgets also can interact with other desktop applications. For example, have your gadget interact when someone starts writing an e-mail message. Your gadget could create boilerplate e-mail messages for you. You can write Desktop Gadgets using Javascript, as with the Universal Gadget, or the C and C++ programming languages, as well as the newer Microsoft .NET languages, C#, and VB.Net. You need to download the software developer’s kit (SDK) in order to develop Desktop Gadgets.

To get started developing Desktop Gadgets download the SDK at desktop.google.com/developer.html.

Google Toolbar API

You can create custom buttons that can be added to the Google Toolbar. These buttons can have custom navigation, search, send, and update capabilities. Custom buttons can be represented as an icon, a drop-down list of icons, or text strings, any of which can be updated by an RSS feed. A custom button can have a tooltip when the mouse hovers over it and an optional title that appears next to the button. This is particularly useful for drop-down buttons.

To make your button functional, you can save important preferences in an XML file. These preferences include such things as a URL you want to have the user navigate to when the button is clicked and URLs that include search parameters or text parameters that send important parameters to the Web site. You also can include an update URL where updates to the button can be obtained.

To create and install a custom button, first create an XML file that defines the button’s important information:

 <?xml version="1.0" encoding="utf-8"?> <custombuttons xmlns="http://toolbar.google.com/custombuttons/">   <button>     <site>http://www.tedcoombs.com</site>   </button> </custombuttons>

You can create custom icons for your new button in a number of different graphic formats. Before you can use it in the Google Toolbar, it needs to be converted to Base 64 ASCII text. Base 64 what? Luckily, this Web site can do that for you: www.motobit.com/util/base64-decoder-encoder.asp.

Simply browse for your file on your computer, and the file is uploaded and encoded for you. Copy and paste the text it creates into your XML file surrounded by an <icon> element like this:

 <icon mode="base64" type="image/x-icon"> /9j/4AAQSkZJRgABAgEAtAC0AAD/4QOuRXhpZgAATU0AKgAAAAgABwESAAMAAA ABAAEAAAEaAAUAAAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAUAAAAc gEyAAIAAAAUAAAAhodpAAQAAAABAAAAnAAAA </icon>

In reality, the text between the begin and end <icon> elements will be much greater than the sample above. To do this quickly and easily, take your favorite picture. Open it in a program like Photoshop. Shrink the image down to 16x16 pixels, and save it. Then upload it into the encoder, copy the text into your XML file with icon elements, and you’re golden.

Note 

The custom button feature currently works only with Internet Explorer.



Google Power Tools Bible
Google Power Tools Bible
ISBN: 0470097124
EAN: 2147483647
Year: 2004
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net