node-twitter
node-twitter copied to clipboard
Next cursor issue.
var params = {screen_name: 'someOne',count: '200', cursor: -1};
client.get('friends/list', params, function getlist(error, list, response)
{
if (!error)
{
for (var index=0,index<list.users.length-1,index++)
{
console.log(index);
console.log("Name: " + list.users[index].name);
console.log("Screen name: " + list.users[index].screen_name);
console.log("followers: " + list.users[index].followers_count);
}
if(list.next_cursor != 0)
{
params.cursor = list.next_cursor
client.get('friends/list',params, getlist);
}
}
)};
I wonder why the first element of the next page is the same that the last element in before page. By this strange behavior I put the final argument of the for loop as: list.users.length-1.