How to use the cursor to navigate the php data collections with stdClass object?


#1

Could you help me? I’m obtaining my twitter followers from php oAuth, but I cant’ show more than 20 followers (I have over 500 followers). i am reading in the web and it says that use the cursoring, but i don’t know how to use it. could you help me?
(Sorry, but i don’t speak english very well)


#2

https://dev.twitter.com/docs/misc/cursoring


#3

I’m using tmhOAuth library to get my friend’s list.
Default number of responses returned is 20.
You could specify the count you want in the count parameter; I’ve set mine to 200.

$connection = new tmhOAuth(array( 'consumer_key' => $consumer_key, 'consumer_secret' => $consumer_secret, 'user_token' => $user_token, 'user_secret' => $user_secret ));

// Connection Request
$connection->request(‘GET’, $connection->url(‘1.1/friends/list.json’),
array(‘screen_name’ => ‘Oscar__Espinosa’,‘count’=>‘200’));

// Get the HTTP response code for the API request
$response_code = $connection->response[‘code’];

// Convert the JSON response into an array
$response_data = json_decode($connection->response[‘response’],true);

// A response code of 200 is a success
if ($response_code <> 200) {
print “Error: $response_code\n”;
}

// Display the response array
var_dump($response_data);