Simple Node.js Twitter (API 1.1) public stream client https://dev.twitter.com/docs/streaming-apis/streams/public
npm install twitter-public-stream
var Stream = require('twitter-public-stream');
var stream = new Stream({
consumer_key: '',
consumer_secret: '',
access_token_key: '',
access_token_secret: '',
track:''
});
//create stream
stream.stream();
//listen stream data
stream.on('data', function(json) {
console.log(json);
});
data
- stream data in JSON formatgarbage
- stream data who can't be parsed to JSONclose
- stream close event (stream connection closed)error
- error event (request error, response error, response status code greater than 200)connected
- stream createdheartbeat
- twitter emitted heartbeat
stream
- create stream connectiondestroy
- destroy/close stream connection
Added new examples and changeParams
method
forked from https://github.com/aivis/user-stream