0

i am using tweetinvi 0.9.7 to fetch data from filtered stream against multiple keywords. i am fetching data against 10 keywords at the same time by using multiple threads.

The problem is only two keywords are fetching the data and rest other threads exited without fetching any data. what are the possible reasons? and how to tackle it. kindly guide me.

1 Answers1

1

you cannot start multiple streams at the same time. In theory you are limited to one but usually you can get 2 running simultaneously.

Here is an example showing how to add multiple tracks to a single stream:

var myKeywordsToFollow = new List<string>
{
    "tweetinvi",
    "twitter",
    ".net",
    "c#"
    // ...
};

var fs = Stream.CreateFilteredStream();

foreach (var track in myKeywordsToFollow)
{
    // The second param is optional but give you an easy way to 
    // configure what you want to do for this specific track
    fs.AddTrack(track, tweet => 
    {
        // Do what you do with the tweet matching your track
    });
}

// Now the stream has 4 tracks!
fs.MatchingTweetReceived += (sender, args) =>
{
    var matchingTracksReceived = args.MatchingTracks;
    var tweet = args.Tweet;
};

fs.StartStreamMatchingAnyCondition();
Linvi
  • 2,077
  • 1
  • 14
  • 28