Hi I am trying to access the twitter rest api https://stream.twitter.com/1.1/statuses/filter.json I am using nodejs.
For authentication I have used ntwitter. Authentication is going through fine. I get the success message.
But once it passes authentication it is not displaying tweets. it shows something like.
----------------------------------------
o/p
----------------------------------------------------------------
tweet[object Object]
success
tweet[object Object]
tweet[object Object]
tweet[object Object]
My prog
-------------------------------------
var twitter = require('ntwitter');
var https = require('https');
var twit = new twitter({
consumer_key: "xxxxxxxxxxxxx",
consumer_secret: "xxxxxxxxxxxxxxxxxxxxxxx",
access_token_key: "xxxxxxxxxxxxxxxxxxxxx",
access_token_secret: "xxxxxxxxxxxxxxxxxx"
});
twit.verifyCredentials(function (err, data) {
console.log("success");
});
twit.stream('statuses/filter', {track:'manipal'}, function(response) {
var body ='';
response.on("data",function(chunk){
//var tweet = JSON.parse(chunk);
console.log("tweet" + chunk);
});
response.on("end",function(){
console.log('Disconnected');
});
});