我尝试了这个,甚至添加了一个游标,但它仍然只能检索前 100 个关注者。
<?php
$cursor = -1;
$account_from = 'username';
do
{
$json = file_get_contents('http://api.twitter.com/1/statuses/followers/' . $account_from .'.json?cursor=' . $cursor);
$accounts = json_decode($json);
foreach ($accounts->users as $account)
{
$a[] = $account->screen_name ;
}
$cursor = $accounts->next_cursor;
}
while ($cursor > 0);
foreach($a as $f) {
echo $f ;
}
?>
有没有更好更简单的方法呢?我哪里错了?请帮忙?