简体   繁体   中英

Getting twitter stream using nodejs twit npm

I am following the link Twit NPM

to get access to twitter stream .

I do the following

var T = new Twit({
    consumer_key:         'key',
    consumer_secret:      'key',
    access_token:         'key',
    access_token_secret:  'key'
});

var stream = T.stream('statuses/sample.json');

stream.on('tweet', function (tweet) {
  console.log(tweet)
});

And i get Bad Request Error 401 . Not sure why ,because if i use curl it works.

ok i figured out. The time on my laptop was 5mins faster that actual time, which was making the call with future timestamp and thus failing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM