1
votes

When using twitter streaming api to filter by user, I found that it is returning tweet that mentions the user, but according to the document in here. It clearly says it "will not contain Tweets mentioning the user".

I was using both track and follow parameter like "track=abc&follow=123,234"

1

1 Answers

0
votes

using both track and follow parameter like "track=abc&follow=123,234" is not possible.

var Twit = require('twit');
var util = require('util');

var config =require('./config');

var T = new Twit(config)
var stream = T.stream('statuses/filter', { follow: ['56488059','2227355222'] , track: ['Covid','Corona'] , language: ['en'] });




stream.on('tweet', (tweet) => {
    console.log(tweet)
    console.log('---------------------')
    }
 );

it is an OR relationship. You will receive a Status object whether the keyword was present or the user id was involved (this includes other users tweeting to your followed user id).