Twitter lists members only returning 20 users

Mar 10, 2014 at 10:39 AM
Edited Mar 10, 2014 at 10:40 AM
Hi again,

I've noticed that TweetList.GetMembersOfList() only ever returns at most 20 members of the list, even when the optional parameter is set.

I'm using the following code:
TweetList.GetMembersOfList(list_id, 500)

The list I'm using as an example has the ID 48814195 and currently has 418 members.

In the output console the GET request has the URL with cursor=-1, so is it only getting the first page and not the full members list?
https://api.twitter.com/1.1/lists/members.json?&list_id=48814195&cursor=-1

Regards,
James
Coordinator
Mar 10, 2014 at 5:09 PM
Hi James,

You are absolutely right. I will update the source code for you tonight.
Sorry for the trouble.

Linvi
Mar 10, 2014 at 6:31 PM
No trouble at all, thank you for the great library and quick work on it!

Much appreciated =)

Sent from my Windows Phone

Coordinator
Mar 11, 2014 at 12:40 AM
Hi,

Sorry for the delay, I have a lot of work currently :(

I think I spoke too fast this afternoon. I did not realized the query was a cursored query.
And consequently the operation is done correctly. I have tried the following code :
var members = TweetList.GetMembersOfList(48814195, 500);
The operation took few seconds but I received a list of 500 users.
Would you please verify you have the latest version of Tweetinvi (0.9.0.2) and try the operation again.

Kind Regards,
Linvi
Mar 11, 2014 at 10:46 AM
Thanks linvi,

I updated to the latest version and yeah you're right, looks like it was my code afterwards not adding the users to a list properly. It does indeed return a list of 500 users.


Many apologies!
James
Mar 11, 2014 at 11:11 AM
Sorry, follow up about the lists, just looked at it closer and believe there is still an issue.

Using the above code, the list of id 48814195 has 418 members, but the query does indeed return a list of 500 users. Looking further at it, it is actually repeating the first 20 users to fill up whatever maximum number you specify in GetMembersOfList(). Filtering out the duplicates leaves me with 20 users and 480 duplicated users.

Watching the console it keeps querying the same URL, with the same cursor (-1), but I would have expected the cursor to increase each call?

I'm using the latest 0.9.0.2 version.

Hope this makes sense, and no rush for a solution or fix, understand you're busy =)

Regards,
James
Coordinator
Mar 11, 2014 at 12:38 PM
Hi James,

Thank you for reporting the issue, I will have a better look to this issue as soon as I can.

Regards,
Linvi
Coordinator
Mar 11, 2014 at 1:41 PM
Thank you very much for identifying this issue. It was a critical bug in the CursorQuery system.
It is now fixed and I have released it under Tweetinvi 0.9.0.3 available in download and nuget.

Nuget command
Update-Package TweetinviAPI
Thank you again.
Linvi
Marked as answer by linvi on 3/11/2014 at 6:41 AM
Mar 11, 2014 at 4:59 PM
That's fantastic, really great work you've done with this, very much appreciated =)