Twitter analytics data via Stream API using OAuth (access token)

蓝咒 提交于 2019-12-11 16:20:12

问题


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:


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


来源:https://stackoverflow.com/questions/26608992/twitter-analytics-data-via-stream-api-using-oauth-access-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!