首页 > 解决方案 > Twitter API:被阻止在 PHP 中检索用户信息?

问题描述

我正在尝试检索 Twitter 用户信息,但我不知道为什么我被阻止,而它正在为关注者信息工作:

// Retrieve followers list with array :
$follows = $oTwitter->get("followers/ids.json?screen_name=fifa&cursor=".$cursor);
$foll_array = (array)$follows;
foreach ($foll_array['ids'] as $key => $val) {
    echo $val; 
}

// Whereas it is nok for list of attributes (meaning not array) :
$oUser = $oTwitter->get("users/show.json?user_id=4366881");
var_dump(get_object_vars($oUser);

=> I get the following error :

array(1) { ["errors"]=> array(1) { [0]=> object(stdClass)#12 (2) { ["code"]=> int(50) ["message"]=> string(15) "未找到用户。" } } }

知道有什么问题吗?

谢谢 !

标签: phpapitwitter

解决方案


推荐阅读