Skip to content

Issue with the twitter API and ntwitter package #129

@aishwaryasavant

Description

@aishwaryasavant

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

});

});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions