Wednesday, 10 May 2017

How can I use the Twitter Stream API to reply to direct tweets on my timeline, but NOT my own?

Here is my code, it works for the most part. It correctly receives tweets posted to my timeline (direct tweets), and correctly responds to them. However, once it has responded to a tweet, it then responds to that response, creating a viscous cycle of never ending responses to myself! How can I alter my function to ONLY respond to tweets on my timeline from other users (not from myself)?

var stream = T.stream('user')

let runStream = function() {
    stream.on('tweet', function (tweet) {
        storeTweetInRedis(tweet)
      console.log('here\'s an example incoming tweet: ', tweet.text)
    })
}



via Aljosha Novakovic

No comments:

Post a Comment