2013-11-26 27 views
1
$cursor = -1; 
$limit = 5; 
while($cursor != 0){ 
    $parameters = array('screen_name' => $q, 'cursor' => $cursor , 'count' => $limit); 
    $method = "followers/ids"; 
    $response2 = $connection->get($method, $parameters); 
    $followerlist = array_merge($followerlist,$response2->ids); 
    $cursor = $response2->next_cursor; 

} 

我做了5個極限,但它給了我所有的追隨者ID的...如果用戶有20名追隨者它給了我20個IDS但我只需要5.我給了5的計數參數,但它似乎忽略它。我究竟做錯了什麼?Twitter的API 1.1讓追隨者/ IDS算不起作用

+0

我看到它是在一個while循環...是有可能,它是在同一時間獲得5直到它獲得全部20個? –

回答

0

如果你只需要只有5結果的時候,有沒有需要的同時loop.Just指定'count' => 5