Skip to content

Instantly share code, notes, and snippets.

@lfcipriani
Created April 19, 2012 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lfcipriani/2418104 to your computer and use it in GitHub Desktop.
Save lfcipriani/2418104 to your computer and use it in GitHub Desktop.
function onMessage(msg) {
// messages stanzas are converted to JSON and then prepended to the correspondent panel in the UI
var result = Collecta.processItem($(msg));
for (var i=0; i < result.length; i++) {
$('#term'+ result[i].term +"panel")
.prepend("<p>["+result[i].category+"] - <a href=\""+result[i].url+"\" target=\"_blank\" title=\" Access "+terms[result[i].term]+" information\">"+result[i].title+"</a><br />..."+result[i].description+"...<br />Published in "+result[i].published+"</p>");
};
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment