document.Yowl.register( "ebay", [ "Found an item" ], [ "Found an item" ], "http://www.ebay.com/favicon.ico" );
select: [ "s", "item" ], where: [ { pattern: [ "?s", "http://ebay.com/item", "?item" ], setUserData: true } ] document.Yowl.notify( "Found an item", "Found eBay item " + ${item.content}, "About to retrieve more information from eBay\'s API", "ebay", "http://www.ebay.com/favicon.ico", false, 0 ); ebay-item
url: 'http://open.api.ebay.com/shopping', params: { appid: 'x-portne-4679-4d53-9b70-0b39272adc78', callbackParamName: 'callbackname', callname: 'GetSingleItem', version: 517, siteid: 0, ItemID: ${item.content}, responseencoding: 'JSON', callback: true }
var item = context.data.Item; document.meta.store.add( "", "${s}", "http://purl.org/dc/elements/1.1/title", { content: item.Title, datatype: "http://www.w3.org/1999/02/22-rdf-syntax-ns" }, true ); document.meta.store.add( "", "${s}", "http://xmlns.com/foaf/0.1/depiction", item.GalleryURL, false );
select: [ "title", "depiction" ], where: [ { pattern: [ "${s}", "http://purl.org/dc/elements/1.1/title", "?title" ], optional: true }, { pattern: [ "${s}", "http://xmlns.com/foaf/0.1/depiction", "?depiction" ], optional: true } ]
if (${title} == undefined) ${title} = { content: "" }; if (${depiction} == undefined) ${depiction} = null; document.Yowl.notify( "Found an item", "For sale: " + ${title.content}, "Full title and thumbnail retrieved using item number", "ebay", ${depiction}, true, 0 );