views:

462

answers:

2

I don't really get how to use the Curesor parameter in Twitter's API, for an exmaple - here. Am I supposed to make a new API call for each 100 followers?

I'd love it if someone could provide a PHP example for getting a full list of followers assuming I have more than 100...

Thanks in advance!

A: 

You need to pass the cursor value back to the API to get the next "chunk" of followers. Then you take the cursor parameter from that chunk and pass it back to get the next chunk. It is like a "get the next page" mechanism.

Matt Breckon
A: 

Check out http://code.google.com/p/twitter-boot/source/browse/trunk/twitter-bot.php

foreach ($this->twitter->getFollowers(,0 ) as $follower)//the 0 is the page
    {
      if ($this->twitter->existsFriendship($this->user, $follower['screen_name'])) //If You  Follow this user
          continue;    //no need to follow now;
      try
      {
        $this->twitter->createFriendship($follower['screen_name'], true); // If you dont Follow Followit now
        $this->logger->debug('Following new follower: '.$follower['screen_name']);
      }
      catch (Exception $e)
      {
        $this->logger->debug("Skipping:".$follower['screen_name']." ".$e->getMessage());
      }

    }

  }
streetparade
this code is about creating friendships not about retrieving the follower lists
Matt Breckon
read the code $this->twitter->getFollowers() will return an array,the above was an example what you can do with that array
streetparade
then you need the definition in this file:http://code.google.com/p/twitter-boot/source/browse/trunk/inc/twitter.php
Matt Breckon