Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with the twitter API and ntwitter package #129

Open
aishwaryasavant opened this issue Dec 5, 2013 · 0 comments
Open

Issue with the twitter API and ntwitter package #129

aishwaryasavant opened this issue Dec 5, 2013 · 0 comments

Comments

@aishwaryasavant
Copy link

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);

});

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant