问题
I am creating a C# console application which I make use to search Twitter using the API. I tried using Twitterizer however the search api with tokens doesn't work which end up with rate limiting error pretty quickly. My question is, does anyone have a code to show me how can I make a Twitter API call in C# using my consumer keys and secrets together with the access token and secrets so that the console app can run by itself without me jumping to a webpage to get a pin like most of the tutorial does? Thanks.
Regards, Andy.
回答1:
If you already have the access token and secret, then that's all you need to call one of the methods that requires authentication.
To call any method on the Twitter API that needs authentication you need 4 items:
- Consumer Token
- Consumer Secret
- Authentication Token
- Authentication Secret
回答2:
If you check google code page for Twitterizer it says:
Are you getting a lot of HTTP 401 error codes? Do your updates say "via Twitterizer"?
That means you've been using Twitterizer Version 1 which uses BASIC authentication. BASIC Authentication has been scheduled for removal from Twitter for months. During the month of August, the hourly limit on the number of updates that is allowable from applications using BASIC authentication is to be lowered every day. On August 31, BASIC authentication will no longer function AT ALL.
So you will either have to use that PIN based authentication or use usual Search API
来源:https://stackoverflow.com/questions/5320529/using-c-sharp-to-access-twitter-api-without-browser-authentication