Hi
I tryed and I did this code.

$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
$access_token['oauth_token'], $access_token['oauth_token_secret']);
$content = $connection->get('account/verify_credentials');
$totalFollowers = $content->followers_count;
$cursor = -1;
$qtd = ceil($totalFollowers/100);
for($z=0;$z<$qtd;$z++){
        $result = $connection->get('statuses/followers', array('cursor' =>
$cursor));
        $cursor = $result->next_cursor_str;
        $user = $result->users;
        $total = count($user);
        for( $i=0;$i<$total;$i++ ){
                $users[] = $user[$i]->screen_name;
        }
}

It works, but I'm afraid about people who has more than 35000
followers
everybody know that 350 is the maximum request that you can do

Someone know something about how around this?

Thanks

On 9 set, 13:49, Abraham Williams <4bra...@gmail.com> wrote:
> $connection = new TwitterOAuth('consumer_key', 'consumer_secret',
> 'access_token', 'access_token_secret');
> $result100 = $connection->get('statuses/followers', array('cursor' => -1));
> $result200 = $connection->get('statuses/followers', array('cursor' =>
> $result100->next_cursor));
>
> You will be best off writing a loop instead of manually specifying how many
> blocks of 100 it pulls in. $result100->users will be an array of users.
>
> Abraham
> -------------
> Abraham Williams | Hacker Advocate |http://abrah.am
> @abraham |http://projects.abrah.am|http://blog.abrah.am
> This email is: [ ] shareable [x] ask first [ ] private.
>
> On Thu, Sep 9, 2010 at 08:59, Paulo Fernandes 
> <paulofernande...@gmail.com>wrote:
>
> > Hi
>
> > I'm beggining in this API and in this group.
>
> > I downloaded 0.2.0-beta3 fromhttp://github.com/abraham/twitteroauth
>
> > I tryed to get all followers, but only retrieved 100 followers.
>
> > How can I get all followers? I saw something about cursor, but I don't
> > know how can I use it.
>
> > Please some help will be useful
>
> > Thanks
>
> > --
> > Twitter developer documentation and resources:http://dev.twitter.com/doc
> > API updates via Twitter:http://twitter.com/twitterapi
> > Issues/Enhancements Tracker:
> >http://code.google.com/p/twitter-api/issues/list
> > Change your membership to this group:
> >http://groups.google.com/group/twitter-development-talk?hl=en

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en

Reply via email to