I am trying to create an in-context gadget that will extract an email address from a Subject or Body gmail message.
I modified the Hello World sample from the Developer's Guide and used the supported google.com:EmailAddressExtractor.
The gadget is not working.
I would appreciate any suggestion about the Gadget and Manifest code.
The full manifest and gadget code can also be seen at mtrott.com/_Gadgets/emManifest.xml and mtrott.com/_Gadets/emGadget.xml
thanks for the help
Marv
Gadget
<?xml version="1.0" encoding="UTF-8"?> <Module> <ModulePrefs title="Client Email Address"> <Require feature="google.contentmatch"> <Param name="extractors"> google.com:EmailAddressExtractor </Param> </Require> </ModulePrefs> <Content type="html" view="card"> <![CDATA[ <script type="text/javascript"> <!-- Fetch the array of content matches. --> matches = google.contentmatch.getContentMatches(); var matchList = document.createElement('UL'); var listItem; var extractedText; <!-- Iterate through the array and display output for each match. --> for (var match in matches) { for (var key in matches[match]) { listItem = document.createElement('LI'); extractedText = document.createTextNode(key + ": " + matches[match][key]); listItem.appendChild(extractedText); matchList.appendChild(listItem); } } document.body.appendChild(matchList); </script> ]]> </Content> </Module>
MANIFESTO
<?xml version="1.0" encoding="UTF-8" ?> <ApplicationManifest xmlns="http://schemas.google.com/ApplicationManifest/2009"> <Name>ClientEmailAddress</Name> <Description>A Gmail contextual gadget to pull the Clients email address from the Subject or Body of the message </Description> <Extension id="navLink" type="link"> <Name>EmailGadget</Name> <Url>http://mtrott.com/index.html?from=google&domain=${DOMAIN_NAME}</Url> </Extension> <Extension id="realm" type="openIdRealm"> <Url>http://mtrott.com</Url> </Extension> <Extension id="EmailAddressExtractor" type="contextExtractor"> <Name>Client Email Address</Name> <Url>google.com:EmailAddressExtractor</Url> <Triggers ref="emGadget"/> <Scope ref="emailSubject"/> <Scope ref="emailBody"/> <Container name="mail"/> </Extension> <Extension id="emGadget" type="gadget"> <Name>Client Email Address Gadget</Name> <Url>http://mtrott.com/_Gadgets/emGadget.xml</Url> <Container name="mail"/> </Extension> <Scope id="emailSubject"> <Url>tag:google.com,2010:auth/contextual/extractor/SUBJECT</Url> <Reason>This application searches the Subject: line of each email for the text "*@.*"</Reason> </Scope> <Scope id="emailBody"> <Url>tag:google.com,2010:auth/contextual/extractor/BODY</Url> <Reason>This application searches the message body of each email for the text "*@.*"</Reason> </Scope> </ApplicationManifest>
source share