gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 19:45:38 27 4
gpt4 key购买 nike

我正在尝试使用 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com