Skip to content

Instantly share code, notes, and snippets.

@bm4cs
Created September 20, 2012 13:24
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 bm4cs/3755880 to your computer and use it in GitHub Desktop.
Save bm4cs/3755880 to your computer and use it in GitHub Desktop.
BlogStreamInsightAustin05
function insert(item, user, request) {
request.execute({
success: function () {
request.respond();
sendNotifications();
}
});
function sendNotifications() {
var channelTable = tables.getTable('Channel');
channelTable.read({
success: function (channels) {
channels.forEach(function (channel) {
var imageSrc = 'ms-appx:///images/good.png';
if (item.maximumLatency > 800) {
imageSrc = 'ms-appx:///images/bad.png';
}
push.wns.sendTileWideImageAndText01(channel.uri, {
image1src: imageSrc,
image1alt: 'Mexia is 1337',
text1: 'Maximum latency across all sources is ' + item.maximumLatency + ' ms'
}, {
success: function (pushResponse) {
console.log("Sent push:", pushResponse);
}
});
});
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment