c# - 仅 Twitter API 应用程序身份验证(使用 TweetSharp)

标签 c# twitter tweetsharp

我正在尝试使用 application-only authentication 从服务器端应用程序检索公共(public)推文(没有用户上下文)。

下面的代码工作正常:

var service = new TwitterService("<consumer key>", "<consumer secret>");
service.AuthenticateWith("<access token>", "<access token secret>"); 

var options = new ListTweetsOnUserTimelineOptions { ScreenName = "billgates" };

foreach (var tweet in service.ListTweetsOnUserTimeline(options))
    Console.WriteLine(tweet.Text);

但是我从这张图中了解到,没有必要提供访问 token / secret :

Application-only authentication

但是,当我删除对 AuthenticateWith 的调用时,ListTweetsOnUserTimeline 返回 null。

这是图书馆的限制,如果不是,我该怎么办?

编辑

据我所知,这调用了 GET statuses/user_timeline根据 documentation 应支持仅应用程序身份验证的方法:

API methods that support this form of authentication will contain two rate limits in their documentation, one that is per user (for application-user authentication) and the other is per app (for this form of application-only authentication)

GET statuses/user_timeline 方法在其文档中显示了这两个限制。

最佳答案

我认为这不是库的限制,而是 Twitter API 的限制。

据我所知,ListTweetsOnUserTimeline() 方法使用 statuses/user_timeline API 调用。

GET statuses/user_timeline

如您所见,此调用需要身份验证。

您可以尝试使用 Streaming API 获取状态。我在这里帮不了你,因为我只有用户流方面的经验,没有公开的经验。

Public streams

此外,TweetSharp 在流方面存在一些问题,我不得不切换到 Linq2Twitter 库。

关于c# - 仅 Twitter API 应用程序身份验证(使用 TweetSharp),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15376570/

相关文章:

c# - 从 javascript 调用的 Web 服务中检索值?

iphone - 以与 Facebook oauth key 类似的方式获取 Twitter oauth key

api - 如何在 unix 中通过 curl 进行 Twitter API 调用

c# - 使用 Tweet# 获取用户的 5 个最新更新

c# - 如何使用 LinqToTwitter 获取推文的 HTML?

c# - 使用 WIF 在 Asp.Net 4.5 上自定义身份验证

c# - 如何在面试中解释委托(delegate)

c# - 用户流和 TweetSharp

c# - Linq to XML 与 DOM

node.js - Zeit/Now 部署停止工作。没有显示错误