Using C# to access Twitter API without browser authentication

核能气质少年 提交于 2020-01-06 20:13:03

问题


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

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