public
Created

  • Download Gist
real-time-comparison.js
JavaScript
1 2 3 4 5 6 7 8 9
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;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.