GetUserFromScreenName returning null

Aug 15, 2014 at 4:24 PM
Hi,

I'm getting some unpredictable behavior from User.GetUserFromScreenName. The method is periodically returning null for valid user names. What is especially confusing is that it will sometimes return a valid user and sometimes return null for the same user name.

Any ideas?

Lewis
Aug 15, 2014 at 5:37 PM
The problem appears to be related to a change in Twitter
https://dev.twitter.com/discussions/32792

You can almost solve it by using the function GetUsersFromScreenNames (or GetUsersFromIds).
They don't have the new limit - but the latter certainly has one major problem.

If you pass an twitterid that has been removed or doesn't exist it breaks down.

To demonstrate the break, try either of the following two twitterids
2401467254
2400668691

Linvi - would it be possible to have a workaround or fix for the problem with GetUsersFromIds when passing an ID that doesn't exist or has been removed?

Thanks again for all your great work.
Aug 15, 2014 at 5:46 PM
Thanks for your response.

I suspected that I was hitting a limit somehow. I looked for a GetUsersFromScreenNames function but could not find it. Another issue with GetUserFromId or GetUsersFromIds is that they take parameters of type int, but there are user ids that are higher than the maximum value for an int (the first user id I looked up in fact).

So, a GetUsersFromScreenNames function would work for me otherwise GetUsersFromIds would have to be modified to take a BigInteger (or maybe just a string).
Aug 15, 2014 at 6:07 PM
Both GetUserFromId or GetUsersFromIds work with Long (Int64) type.

Certainly in the version I have.
Coordinator
Aug 15, 2014 at 6:38 PM
I love twitter updates...
Yes I will be working on it quickly.

Linvi
Coordinator
Aug 18, 2014 at 12:20 AM
Hello there,

I have tried to reproduce the problem you were referring to, but the rate limit seems to work fine for me.
Would you please confirm that the problem is still occurring?

Linvi