Hoe maakt u van uw succesvolle dominotoepassing een
Google gadget?
U kunt een persoonlijke startpagina maken wanneer u een Google account heeft: iGoogle. Deze pagina kunt u geheel naar eigen inzicht inrichten. Op verschillende tabbladen kunt u allerlei gadgets toevoegen. Hiermee bouwt u in feite uw eigen portal. Alle informatie, die beschikbaar is op het internet, is binnen handbereik. Naast allerlei grappige, handige, leuke gadgets om het weer, verkeer, spelletjes of nieuws te tonen, zijn er ook allerlei bedrijven die hun informatie op deze manier publiek beschikbaar maken.
Gadgets zijn dus interactieve minitoepassingen die u overal op uw bureaublad (Google Desktop) of op uw iGoogle-startpagina kunt plaatsen om bijvoorbeeld nieuwe e-mails, het weerbericht, foto's en gepersonaliseerd nieuws te bekijken. Maar u kunt gadgets ook toevoegen aan de Sidebar in Lotus Notes 8!
Voorbeeld van een gepersonaliseerde iGoogle pagina
hoe maakt u van een publieke webtoepassing een Google gadget?
minimale opzet
Uiteraard moet u een webtoepassing hebben die u als Google gadget wilt aanbieden. De webtoepassing moet anoniem te gebruiken zijn (dus geen authenticatie nodig).
Bovenstaande link verwijst naar een complete pagina; om als Google gadget te kunnen functioneren dient u aan uw beschikbare ruimte denken. Voor dit voorbeeld maakt het niet uit.
Naast de bestaande URL, is een URL nodig waarmee de gadget beschrijving kan worden opgehaald:
Gadgets worden beschreven in xml formaat, in minimale vorm ziet dit er als volgt uit:
voorkeuren
Het aardige van google gadgets is dat u ook met voorkeuren kunt werken. Denk hierbij aan kleurinstellingen, standaard locatie, filter etcetera. Hiervoor kunt u de <UserPref> sectie gebruiken. Onderstaand voorbeeld stelt de eindgebruiker instaat om te kiezen uit de kleuren Rood, Groen of Blauw.
<UserPref name="kleur"
display_name="kleur"
datatype="enum"
default_value="R">
<EnumValue value="R" display_value="Rood"/>
<EnumValue value="G" display_value="Groen"/>
<EnumValue value="B" display_value="Blauw"/>
</UserPref> |
De gebruiker van de gadget kan via de
edit link in de gadget nu zelf kiezen welke kleur de gagdet moet worden.
testen
Vanaf de iGoogle home page kunt u via de link Add stuff de gadget testen, klik op Add feed or gadget en geef de url van de gadget.xml op zoals hieronder:
De Gadget wordt nu toegevoegd aan uw iGoogle pagina.
Vanaf hier kunt u door te kiezen voor `Share this gadget' de gadget delen met anderen.
Met deze methode heeft u uiteraard een beperkt bereik, als u onbekenden wilt laten werken met de gadget zult u hem moeten registreren.
registreren bij Google
Als u helemaal tevreden bent, dan wilt u natuurlijk dat derden de gadget gaan gebruiken. Nu worden er meer eisen gesteld aan de informatie in de gadget.xml. Onderstaande lijst van gegevens die u moet invullen namen wij rechtstreeks over van de Google pagina:
- title
- description.
This attribute is important to let people know what your gadget does, particularly if it is not obvious.
- author
- author_email.
This is so that Google and users of your gadget can contact you. You can use any email system, but you should not use a personal email address because of spam. One approach is to use an email address of the form helensmith.feedback+coolgadget@gmail.com in your gadget spec. Gmail drops everything after the plus sign (+), so this email address maps to helensmith.feedback@gmail.com. You can create a Gmail account here.
- screenshot.
This is a string that gives the URL for a gadget screenshot. This must be a well-formed URL, not a relative URL. This image must be on a public web site that is not blocked by robots.txt. PNG is the preferred format, though GIF and JPG are also acceptable. Gadget screenshots should be 280 pixels wide. The height of the screenshot should be the "natural" height of the gadget when it's in use. This helps users understand how much space a gadget will consume on their screen before they add it to their page. The screenshot should not have any whitespace above the gadget's blue header bar. Screenshots should show your full gadget, including its title bar, but nothing else. Alternatively, you can screenshot the gadget with the edit window open. Screenshots should not be resized or cropped. For quality and consistency, Google may take its own screenshots of a given gadget.
- thumbnail.
Thumbnails are used in the content directory to give users a preview of a gadget. They should capture the main functionality of your gadget without showing it in its entirety. The value for this attribute is a string that gives the URL for a gadget thumbnail. This must be a well-formed URL, not a relative URL. This image must be on a public web site that is not blocked by robots.txt. PNG is the preferred format, though GIF and JPG are also acceptable. Thumbnails should be 120x60 pixels. They should not include title bars.
- author_location
- author_affiliation
- title_url.
You use this attribute to link your gadget title to an external HTML page. For example, if your gadget is a front end for a service, you can link the gadget title to that service's website.
- directory_title
(required if title contains user preference substitution variables).
Zodra de gagdet geregistreerd is in de gadget directory, is deze door anderen te gebruiken. Bedenk wel, de gadgets zijn publiek, iedereen mag ze dus gebruiken zonder uw toestemming.