Skip to content

Instantly share code, notes, and snippets.

@jdub
Created February 13, 2011 04:19
Show Gist options
  • Save jdub/824435 to your computer and use it in GitHub Desktop.
Save jdub/824435 to your computer and use it in GitHub Desktop.
node-twitter sitestreams, http vs. https
var twitter = new require('twitter')({
consumer_key: 'XXX',
consumer_secret: 'XXX',
access_token_key: 'XXX',
access_token_secret: 'XXX',
// sitestreams
site_stream_base: 'https://betastream.twitter.com/2b'
}),
params = {
follow: [ 4690301, 15352541 ],
'with': 'followings'
};
twitter.stream('site', params, function(stream) {
stream.on('data', function(json) {
console.log('JSON: ' + JSON.stringify(json).length);
});
setTimeout(function() {
console.log('USER-INITIATED DISCONNECT');
stream.destroy();
console.log(require('util').inspect(stream));
}, 7500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment