ZF-9215: Zend_Service_Twitter::userFriends() uses deprecated pagination parameter
Description
The {{userFriends()}} method of the {{Zend_Service_Twitter}} class accepts an array of options as its only parameter. The {{'page'}} parameter is included in the request made to the Twitter API. As of the date of this issue being filed, this parameter is deprecated. According to the documentation for the API method statuses/friends, {{'cursor'}} is the current preferred pagination parameter. (Yes, it's inconsistent with the parameter of the same nature in other methods, such as statuses/friends_timeline.)
A patch to {{userFriends()}} is required to properly paginate results from this method, which has been attached to this issue. Additionally, the documentation for {{Zend_Service_Twitter}} should be updated to reflect the different usage of the current parameter versus the deprecated one. An example of this is shown below.
$twitter = new Zend_Service_Twitter('username', 'password');
$cursor = -1;
do {
$response = $twitter->user->friends(array('cursor' => $cursor));
$cursor = (int) $response->next_cursor;
} while (count($response->user) == 100);
Comments
Posted by Matthew Turland (elazar) on 2010-02-19T15:16:56.000+0000
Attached {{Twitter.php.diff}} patch to {{userFriends()}}
Posted by Tom Shaw (tomshaw) on 2010-06-19T09:42:00.000+0000
I've got both the friends and follower methods to work by removing the integer cast. Twitter is using an eighteen or nineteen digit cursor number.
Posted by Thorsten Suckow-Homberg (thorsten_suckow) on 2011-05-12T19:33:53.000+0000
Yap, needs a fix. Noone taking care of the Twitter API anymore?
Posted by Jean-Christophe Meillaud (jc.meillaud) on 2011-06-14T23:38:48.000+0000
The fix is not that hard to add, what happens ?