gpt4 book ai didi

c# - 如何使用 twitter api 获取好友事件?

转载 作者:太空宇宙 更新时间:2023-11-03 16:08:41 27 4
gpt4 key购买 nike

我无法从返回我 friend 事件的 twitter api 获取列表或集合。

基本上我想要我 friend 的事件列表,就像推特在其网站上有事件或互动部分一样。

最佳答案

您可以使用网站流来做到这一点。首先,获取您 friend ID 的列表,然后将他们添加到站点流中。下面是一个使用 LINQ to Twitter 的示例:

        Console.WriteLine("\nStreamed Content: \n");
int count = 0;

(from strm in twitterCtx.UserStream
where strm.Type == UserStreamType.Site &&
strm.Follow == "15411837,16761255"
select strm)
.StreamingCallback(strm =>
{
Console.WriteLine(strm.Content + "\n");

if (count++ >= 10)
{
strm.CloseStream();
}
})
.SingleOrDefault();

您可以在 LINQ to Twitter Documentation 中找到更多信息.

此外,无论您使用何种技术,都应该阅读 Twitter's Site Streams documentation .

注意:Twitter 站点流处于测试阶段,因此您需要联系他们才能访问。

关于c# - 如何使用 twitter api 获取好友事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18315580/

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