-
Notifications
You must be signed in to change notification settings - Fork 163
Description
I am trying to execute the below simple code. Yet the code isnt working. It shows 401 error.
What am i missing? I have loaded the ntwitter package and is present in one folder on my local machine. the same folder contains the below twitter.js file.
I am running this on Mac.
Not sure why its not returning me any data. Please suggest.
var http= require('http').createServer(),
util = require('util'),
twitter=require('ntwitter');
console.log(twitter);
http.listen(3000);
var twit= new twitter({
consumer_key: 'key',
consumer_secret: 'consumer_seceret',
access_token_key: 'access_token_key,
access_token_secret: 'access_token_secret'
});
twit.stream('statuses/filter',{track:['beiber']},function(stream){
stream.on('error', function(error, code) {
console.log("My error: " + error + ": " + code);
});
stream.on('data',function(data){
console.log(data.user.screen_name+ ' : ' +data.text);
});
});