Created
February 13, 2011 04:19
-
-
Save jdub/824435 to your computer and use it in GitHub Desktop.
node-twitter sitestreams, http vs. https
This file contains 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
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