问题
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