booksnew/tools/twitter.js
2015-07-15 14:15:01 +01:00

45 lines
704 B
JavaScript

function getJSONfeed(feedurl){
var xmlhttp= WScript.createobject("Msxml2.XMLHTTP.3.0");
xmlhttp.open( "GET", feedurl, false);
xmlhttp.send();
var rssJSON_Data = eval ("(" + xmlhttp.responseText +")");
return rssJSON_Data;
}
function getJSONfeedDUMP(feedurl){
var xmlhttp= WScript.createobject("Msxml2.XMLHTTP.3.0");
xmlhttp.open( "GET", feedurl, false);
xmlhttp.send();
WScript.Echo(xmlhttp.responseText);
}
var twitfeed =getJSONfeed("http://twitter.com/statuses/public_timeline.json");
WScript.Echo(twitfeed[0].user.name);
for (var i = 0; i < twitfeed.length; i++)
{
WScript.Echo(twitfeed[i].user.name);
WScript.Echo(twitfeed[i].text);
WScript.Echo("");
}