2016-04-28 9 views
-2

Im mit tweetinvi in ​​C# erhalten Strom von Tweets für die Analyse zu bekommen, gibt es eine Weise, die ich in Echtzeit erhalten können oder gefiltert Tweets lebenWie Live-Tweets in C# tweetinvi Bibliothek

+0

Was haben Sie versucht, und was nicht funktioniert hat? Wenn Sie die Bibliothek gefunden haben, bin ich sicher, dass Sie sich das [Wiki] angesehen haben (https://github.com/linvi/tweetinvi/wiki/Streams) – Stephen

Antwort

1

Ich bin der Entwickler von Tweetinvi . Ich bin mir nicht sicher, ob Sie die Filtered Stream documentation lesen.

Aber hier ist, wie können Sie tun, was Sie in wenigen Zeilen wollen:

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();