我正在尝试通过此 API 调用获取特定用户的所有 Twitter 关注者
https://api.twitter.com/1/users/lookup.json?screen_name=twitterapi,twitter&include_entities=true
那里有一个示例输出:
https://dev.twitter.com/docs/api/1/get/users/lookup
我正在尝试通过执行以下操作来获取用户的屏幕名称:
$json2=file_get_contents('http://api.twitter.com/1/users/lookup.json?user_id='.$post.'') ;
$accounts2 = json_decode($json2);
while( $element = each( $accounts2 ) ) {
echo $element[ 'screen_name' ];
echo '<br />';
}
其中 $post 是连接在一起的所有 id(大约 100 个)。
以上将失败:
Notice: Trying to get property of non-object
请问有什么帮助吗?