Skip to content

Instantly share code, notes, and snippets.

@mneedham
Created March 15, 2010 00:13
Show Gist options
  • Select an option

  • Save mneedham/332359 to your computer and use it in GitHub Desktop.

Select an option

Save mneedham/332359 to your computer and use it in GitHub Desktop.
var sys = require("sys"),
http = require('http')
exports.getTweets = function(callBack) {
var twitter = http.createClient(80, "www.twitter.com");
var request = twitter.request("GET", "/statuses/friends_timeline.json",
{"host": "www.twitter.com",
"Authorization" : "Basic " + "xxx"});
request.addListener('response', function (response) {
var tweets = "";
response.addListener("data", function (chunk) {
tweets += chunk;
});
response.addListener("end", function() {
callBack.call(this, tweets);
});
});
request.close();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment