-2

Im using tweetinvi in c# to get stream of tweets for analysis , is there a way i can get real-Time or live filtered tweets

K A
  • 19
  • 2
  • What have you tried, and what didn't work? If you found the library, I'm sure you've looked at the [wiki?](https://github.com/linvi/tweetinvi/wiki/Streams) – Stephen Apr 28 '16 at 13:51

1 Answers1

1

I am the developer of Tweetinvi. I am not sure if yoiur read the Filtered Stream documentation.

But here is how you can do what you want in few lines:

var stream = Stream.CreateFilteredStream();

// Add all your filters with AddTrack
stream.AddTrack("tweetinvi");
stream.AddTrack("rest");

stream.MatchingTweetReceived += (sender, args) =>
{
    // This event will be invoked every time a tweet created is matching your criteria
    var tweet = args.Tweet;


    // If you want to get all the matching values
    var matchingTracks = args.MatchingTracks;
    var matchingFollowers = args.MatchingFollowers;
    var matchingLocations = args.MatchingLocations;

    // If you want to know which criteria has matched
    var matchedOn = args.MatchOn;
};

stream.StartStreamMatchingAllConditions();
Linvi
  • 2,077
  • 1
  • 14
  • 28