Gadget Editor

The Google Gadget Editor is no longer available. See instructions HERE

Here is an alternative:

  1. Use a plain text editor (Notepad). Start with the gadget text below. 
  2. Replace the title "My Gadget"  with an appropriate title.
  3. Replace "My code" with your gadget code. 
  4. Save it to to your computer with the filetype '.xml'.
  5. Go to Google Drive.
  6. Create Folder (Name your folder and set Share to Public).
  7. Upload your xml file to it
  8. Select the file.
  9. Click the Share button at the top of the page.
  10. Click Advanced in the bottom right corner of the sharing box.
  11. Click Change....
  12. Choose On - Public on the web and click Save.
  13. Before closing the sharing box, copy the document ID from the URL in the field below "Link to share". The document ID is a string of uppercase and lowercase letters and numbers between slashes in the URL. Example:
  14. Create a URL that looks like[doc id] where [doc id] is replaced by the document ID you copied in the previous step. Example:
  15. Open the Google Sites Page (where you want to add your script).
  16. Edit the page
  17. Insert>>More Gadgets>>Add gadget by URL.
  18. Paste the link from step 14 into the box.
Note: Hosting these files in Google Drive is being discontinued so I recommend using DropBox instead.  You can also host your XML files in a file cabinet page in a Google site.  HTML files will have to be converted to gadgets.  See This Site

You can also install a 3rd party App to use with Drive to edit your gadget directly from Drive.

Gadget Text
<?xml version="1.0" encoding="UTF-8" ?>  
  <ModulePrefs title="hello world example" />  
  <Content type="html"> 
       Hello, world! 

The above instructions have been revised to follow what is suggested by the current Google Drive help instructions.

Note that it now says:
On August 31, 2015, web hosting in Google Drive will be deprecated. You can continue to use this feature until August 31st, 2016, but after that, will no longer work.

More gadget instructions from Google