node-twitter icon indicating copy to clipboard operation
node-twitter copied to clipboard

Next cursor issue.

Open hrivera2014 opened this issue 6 years ago • 0 comments

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.

hrivera2014 avatar Jun 26 '18 04:06 hrivera2014