-3

我在 c# 中使用 tweetinvi 来获取推文流进行分析,有没有办法我可以获得实时或实时过滤的推文

4

1 回答 1

1

我是 Tweetinvi 的开发者。我不确定您是否阅读了Filtered Stream 文档

但是,您可以通过以下几行来做您想做的事情:

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();
于 2016-04-29T09:11:08.977 回答