Created
September 20, 2012 13:24
-
-
Save bm4cs/3755880 to your computer and use it in GitHub Desktop.
BlogStreamInsightAustin05
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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