twitter\u time不提供转发用户的follower\u计数

twitter\u time不提供转发用户的follower\u计数,twitter,Twitter,我正在使用twitter\u timeline获取用户详细信息 它提供了一组tweet,包括RTs。我正在考虑所有推特的转发 假设我转发了任何推文,我可以使用: $tweets3 = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?trim_user=true&include_rts=true"); foreach ($tweets3 as $item) {

我正在使用
twitter\u timeline
获取用户详细信息

它提供了一组tweet,包括RTs。我正在考虑所有推特的转发

假设我转发了任何推文,我可以使用:

$tweets3 = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?trim_user=true&include_rts=true");

 foreach ($tweets3 as $item)
        {
                $rt_reach =  $item->retweet_count; //This is available
                $text = $item->text; //This is available

                $follower_count = $item->user->followers_count; //This is not available
                echo "User location $item->user->location"; //This is not available
                echo  $follower_count = $item->user->screen_name; //This is not available
        }
链接到文档:

为什么不在上面的代码中提供最后三个值?

因为您使用的是“trim\u user=true”,twitter会删除用户记录,但用户id除外。 请检查trim_用户参数


应用程序使用“trim_user”参数来阻止推文数据膨胀,如果应用程序需要完整的用户记录,则应将其排除在外,这对您来说似乎就是如此。

谢谢,但是
trim\u user=true
会删除属于用户id的记录。我认为这与您所说的相反。这是我所说的,但可能我没有正确地说出来。trim_user将只返回推文创建者的用户id,并删除推文用户的所有其他信息。此外,您似乎想要原始推文的信息,而不是转发者的信息。准确吗?为此,您需要查看“Retweetd_status”项目,其中包含原始tweet对象,并在原始tweet创建者的tweet对象中查找用户对象。在任何情况下,您都必须删除trim_用户参数或将其设置为false。您有联系吗?我对twitter API@Vishal还有一个疑问