Case smashing (forced lowercase) in player profile

Sort:
skelos

Hi all,

Compare:

https://www.chess.com/member/dj_haubi

with:

https://api.chess.com/pub/player/dj_haubi

 

(Thorsten's just an example; I'd use @erik but his username is all lowercase already.)

 

I understand I think why restricting usernames to alphanumeric plus hyphen and underscore in ASCII is sensible, and forcing a single case simplifies a lot of searches I'm sure.

 

What is lost is a way to get the member's own preference about capitalisation of their username, and some are a lot easier to handle in mixed case (remember and even type) than all lower case.

As the website is pulling data from somewhere, is the player profile not using the same data source or is it modifying the data once fetched?

In the particular instance of the player profile, I would like to see any mixed case the member used when joining, or chose during a name change.

I'd prefer to see the mixed case names anytime I get names, I think, as for presentation purposes it might sometimes avoid a profile lookup to get the name "right". Except that currently I know of no way to get a username "right".

Is there  a method I've missed? If not, please consider this an enhancement request! wink.png

andreamorandini

@skelos at first we decided to display usernames all lowercase to not confuse people when composing the endpoints ( for example https://api.chess.com/pub/player/dj_haubi/stats and not https://api.chess.com/pub/player/dj_Haubi/stats ).

But at the beginning there wasn't a nice redirect message when the user used the uppercase version of the username, so I think we can reconsider our choice. 

I will keep you informed.

 

skelos

Thanks.

I confess I'd not noticed the redirect, but mostly when I do multiple lookups they're from some other data fetch (match data, club data, ...) so it sounds like it might be best to continue supplying the lowercase names in such results, but if the profile could give the "preferred" capitalisation that would be a win for presentation in some situations.

andreamorandini

Dear @skelos we cannot change the username capitalization so we added an "url" property (as there is already in other endpoints). So you will get something like this:


{

 "@id":"https://api.chess.com/pub/player/dj_haubi",
 "url":"https://www.chess.com/member/DJ_Haubi"
}

 

It should be easy to extract the username from the "url" and this we are not breaking retro-compatibility.

The change will be documented in the upcoming hours in the documentation.

 

 

skelos

Thanks Andrea.  A very neat solution.

I appreciate you spending time to think about a solution which doesn't break compatibility but does make the user's preferred capitalisation available. Please point your boss at this thread to show what a great job the api.chess.com users (or at least I) think you're doing!

andreamorandini

Thank you for your words, that are much appreciated. But the first persons to thank are you and other people that are taking time to test and provide such valued feedback to us.

So, thank you!

skelos

Not only test, but use. I am careful now about what I try to do to make sure it works as expected, but some of api.chess.com I've been using since before Christmas. I put a note in the "working code" thread about finding players and using their location (when it's not fanciful, rude or missing) to identify players for Australian city/state teams.

I've also done some work preparing for matches and have a very preliminary prediction of results, to judge whether we need more "get out the vote" (er, "register to play!") encouragement or not.

This latest enhancement will make reporting who is in and out of matches more readable. Unlike  you and me, some people do use mixed case usernames.

Cheers!