public
Created

Windows Azure Mobile Services Scheduler

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
function CheckFeed() {
getUpdatesAndNotify();
}
 
var request = require('request');
function getUpdatesAndNotify() {
request('http://search.twitter.com/search.json?q=@cloudnick&rpp=2',
function tweetsLoaded (error, response, body) {
var results = JSON.parse(body).results;
if(results){
results.forEach(function visitResult(tweet){
sendNotifications(tweet);
});
}
});
}
 
function sendNotifications(tweet){
 
var channelTable = tables.getTable('Channel');
channelTable.read({
success: function(channels) {
channels.forEach(function(channel) {
 
push.wns.sendTileWideSmallImageAndText04(channel.uri, {
image1src: tweet.profile_image_url,
text1: '@' + tweet.from_user,
text2: tweet.text
});
 
});
}
});
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.