Twitter analytics data via Stream API using OAuth

2019-09-14 21:42发布

I want the twitter analytics data, some values like:

  • retweets, *followers,
  • demographics and
  • geographic data.

I have Access Tokens for multiple users, and I want to access their data of Twitter Analytics.

I have checked this thread too: C# console application Streaming API 1.1 + Oauth

but my scenario is different, I don't want the data for a single user only, I have multiple users with their access tokens. How can I accomplish this task?

I have seen their Rest API, it's not possible from it. So I have moved towards Twitter's Streaming API, but I have seen many blogs which keeps telling that Twitter's Stream API can't be used via OAuth.

I am using C#.

1条回答
趁早两清
2楼-- · 2019-09-14 22:00

It is definitely possible to use OAuth to access the Twitter Stream API. Simply use Tweetinvi, set your credentials and you should be able to access the Streaming API straight away.

TwitterCredentials.SetCredentials(credentials);

var stream = Stream.CreateUserStream();
stream.TweetCreatedByMe += (sender, args) =>
{
    Console.WriteLine("User posted : ", args.Tweet.Text);
};
stream.StartStream();
查看更多
登录 后发表回答