Last active
December 16, 2015 16:10
-
-
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"
This file contains hidden or 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) { | |
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