On 25-Mar-2011, Twitter announced a change to friends_ids and
followers_ids API methods:
[Soon] followers/ids and friends/ids is being updated to set the cursor to -1
if it isnt supplied during the request. This changes the default response
This will break a lot of existing code. The AutoCursor trait was created to
help users transition to cursor based access for these methods.
With default parameters, the AutoCursor trait attempts a non-cursored call
for friends_ids and followers_ids. If it detects a cursored
response from Twitter, it continues to call the underlying Twitter API method,
with the next cursor, until it has received all results or 16 calls have been
made (yielding 80,000 results). It returns an ARRAY reference to the combined
If the cursor parameter is passed to friends_ids or followers_ids,
Net::Twitter assumes the user is handling cursoring and does not modify
behavior or results.
The AutoCursor trait is parameterized, allowing it to work with any Twitter
API method that expects cursors, returning combined results for up to the
maximum number of calls specified.
AutoCursor can be applied multiple times to handle different sets of API