Skip to content

Instantly share code, notes, and snippets.

@JuanKRuiz
Last active December 16, 2015 16:10
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 JuanKRuiz/5461656 to your computer and use it in GitHub Desktop.
Save JuanKRuiz/5461656 to your computer and use it in GitHub Desktop.
This code shows how to query twitter API and send notifications to "Windows 8" App using "Windows Azure Mobile Services"
function insert(item, user, request) {
var httpRequest = require('request');
var url = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name='+item.text+'&count=3';
httpRequest(
url,AnalyzeContent
);
request.execute();
function AnalyzeContent(error, request, body)
{
var listaTweets = JSON.parse(body);
listaTweets.forEach(NotifyFromTweets);
}
function NotifyFromTweets(tweet)
{
push.wns.sendToastImageAndText02(item.channel,
{
text1:tweet.user.screen_name,
text2:tweet.text,
image1src:tweet.user.profile_image_url
});
push.wns.sendTileWideSmallImageAndText04 (item.channel,
{
text1:tweet.user.name,
text2:tweet.text,
image1src:tweet.user.profile_image_url
}
);
console.log("Exitoso");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment