简体   繁体   中英

NodeJS nTwitter Demo

Is there any sample Demo for Streaming Tweets from Twitter using nTwitter?

I have configured my access and secret keys from dev.twitter.com.

But still a fully guided Tutorial would Help I referred to http://blog.semmy.me/post/17390049513/streaming-twitter-with-ntwitter-and-node-js This Tutorial, But couldn't figure out the client side.

Also tried using socket.io but to no avail.

What are you having trouble with? Setting up a stream is super easy - the blog you posted even has the code samples all ready:

var t = new twitter({
  consumer_key: 'your',
  consumer_secret: 'twitter',
  access_token_key: 'keys',
  access_token_secret: 'here'
});

t.stream(
  'statuses/filter',
  { track: ['awesome', 'cool', 'rad', 'gnarly', 'groovy'] },
  function(stream) {
    stream.on('data', function(tweet) {
      console.log(tweet.text);
    });
  }
);

However, you should check out other forks of ntwitter like mtwitter, as ntwitter hasn't been updated in a long time. If streaming is the only thing you need, you can check out my fork https://github.com/mileszim/twat that handles all the reconnection and backoff guidelines.

i came accross this demo a while ago its a complete demonstration of nodejs and ntwitter also easy to understand. this should do

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