开发者

How do I host a Google gadget? How does it work?

开发者 https://www.devze.com 2022-12-23 00:19 出处:网络
I just spent 5 hours by checking Google gadgets websites and FAQs, but I still have no idea how to host a gadget.

I just spent 5 hours by checking Google gadgets websites and FAQs, but I still have no idea how to host a gadget.

What I'开发者_如何学编程ve figured from reading the Google documentation:

  1. I can write gadgets with XML, JavaScript etc..
  2. Gadgets can be added to iGoogle etc..
  3. Google can host the gadgets for you.
  4. Gadgets can be hosted anywhere else???

All of the above information doesn't answer my question. For instance, with jQuery or Dojo Toolkit, I can download the JavaScript framework and use it. With Google gadgets, I can not find a download link for a framework. Why? Does Google provide its framework? If not, why does the documentation indicate that gadgets can be hosted anywhere? I am totally confused.

A brief explanation or some helpful links are very welcome! Thanks a lot!!!


I've just been trying to get my head around all this myself and most of the information out there seems to be about building gadgets, not the infrastructure of hosting them.

Essentially the way it seems to work is that you need:

  1. Somewhere to host the XML file that defines the gadget. This can be anywhere on the web.
  2. A Google Gadget container - you tell this the URL of the XML file for your gadget and it does the magic to turn your XML into a rendering gadget. Examples are iGoogle http://www.google.com/ig, Google Friend Connect http://www.google.com/friendconnect/ and Shindig http://shindig.apache.org/
  3. A site to actually display the Gadget - this can either be a site with the functionality inbuilt such as iGoogle or can be any website on which you put the embed HTML for the gadget. This embed HTML will vary according to the container. If you go to a gadget in iGoogle, that you've either added or is in their directory, you can see the embed code for the gadget. For Google Friend Connect, there's a snippet of HTML and Javascript that you can use, in which you put the URL of the XML file and your Google Friend Connect site id.

The fact that some sites such as iGoogle do 1, 2 and 3 is I think what initially made things slightly confusing for me.


You can create a gadget defining an xml spec (reference) and host it anywhere you want (ie. your dropbox public folder). The xml will have a Content section with the html for the gadget. There you can include script tags with any js library you want to use (ie. jquery, dojo, your own js files).

If you want to install the gadget in iGoogle, you need to go to 'Add Stuff' and instead from picking a gadget from the directory, you click on 'add rss or gadget' link and enter the url to your gadget xml file. The container (in this case iGoogle, but could be Orkut, MySpace, etc) will pull your gadget spec and render the gadget.

Here's a good place to start with gadget development


Beside iGoogle and others Gadgets containers, you can also host gadgets on any page where you can include a script. Google has a site that will generate for you the script that will show the gadget on your page: http://www.google.com/webmasters/gadgets/foryourpage/

The generated code uses www.gmodules.com. However I've not found much more information.


I think its late to answer the question. Here are few comments which could help others.

Google can host the gadgets for you?? - Yes

Gadgets can be hosted anywhere else??? - Yes. You can host on your own server or dropbox public folder does work too.

The easiest way to create and host gadget is to use google gadget editor. Which does all we need to have our own google gadget.

The link to google gadget editor is http://www.google.com/ig/ifr?url=gge.xml. Here you can edit and host the gadget. Below are the screenshots for reference.

Once you've got something you want to test, click the file menu, and select 'SAVE' as shown below.

How do I host a Google gadget? How does it work?

Once you've saved (and selected a good name for your xml file), you'll see it changes from hello.xml to something else.

How do I host a Google gadget? How does it work?

Then, it's as easy as doing a right-click and saving the location to the clipboard. Here's how that looks in Firefox.

How do I host a Google gadget? How does it work?

That's it. The link to ur google gadget will be in ur clipboard. Which looks something like this.., http://hosting.gmodules.com/ig/gadgets/file/117733801868661729078/my-first-gadget.xml

0

精彩评论

暂无评论...
验证码 换一张
取 消