Twitter API: Get Followers +99

前端 未结 7 731
悲&欢浪女
悲&欢浪女 2021-02-06 08:05

Using the twitter API (and OAuth) if i was to call for the user followers, (statuses/followers) i would be returned only 99 results.

Is there a way i can return 99, then

7条回答
  •  悲哀的现实
    2021-02-06 08:48

    $cursor = -1;
    $account_from = 'twitter_account';
    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)
        {
    
                array(
                    ':twitter_id' => $account->id_str,
                    ':account' => $account->screen_name,
                    ':description' => $account->description,
                );
        }
        $cursor = $accounts->next_cursor;
    
    }
    while ($cursor > 0);
    

提交回复
热议问题