AJ

  • Newbie
  • Posts: 21
  • Trades: 3

[Lestrades.com] Nao 尚

  • I'm Share-Locked
  • Administrator
  • Posts: 1,349
  • Trades: 217

AJ

  • Newbie
  • Posts: 21
  • Trades: 3

[Lestrades.com] Nao 尚

  • I'm Share-Locked
  • Administrator
  • Posts: 1,349
  • Trades: 217
Re: What's up at Lestrade's?
« Reply #783,  »
I've had a quick look at the URL system.
Apparently, the code does check for a Steam ID when the URL is in the format /profiles/123456
I didn't know what to change to make sure it was... I'm pretty sure nothing was needed, but you can also use the format /profils/steamid123456 and then you can be sure it won't be mixed up with something else.

Anyway, TL;DR: I'd already implemented Steam ID redirection years ago, simply forgot about it, and it's /profiles/(steam ID)

AJ

  • Newbie
  • Posts: 21
  • Trades: 3
Re: What's up at Lestrade's?
« Reply #784,  »
Quote from [Lestrades.com]Nao 尚 on December 28th, 2020, 10:34 PM
Anyway, TL;DR: I'd already implemented Steam ID redirection years ago, simply forgot about it, and it's /profiles/(steam ID)
But the problem is how do I create a Lestrades.com link when the URL of the Steam profile is in the "/id/(Steam custom names)" format and the names in the URL are different in both webpages of the Steam and Lestrades.com, e.g. like yours?

[Lestrades.com] Nao 尚

  • I'm Share-Locked
  • Administrator
  • Posts: 1,349
  • Trades: 217
Re: What's up at Lestrade's?
« Reply #785,  »
I don't get it... You can provide a custom name in the @ url format, or a steam ID if there's no custom name... The /profiles/ shortcut is only there if you reliably have a steam ID, and want to make sure you're redirected to the proper user profile.

Happy new year everyone, by the way..!

AJ

  • Newbie
  • Posts: 21
  • Trades: 3
Re: What's up at Lestrade's?
« Reply #786,  »
The Steam ID format is no problem here because it's a unique number.  But to use a Steam custom name in the URL for a Lestrades.com profile could be a little tricky for creating a link for that profile because they might be different for some reasons.  For example, your custom name in the URL on the Steam profile is: "../id/naogilles/" but on the Lestrades.com is:  "../@Nao/".   Therefore, I can't use the custom name to create the Lestrades.com profile link because there is no such URL ("../@naogilles/") on the Lestrades.com.  Any idea to have a workaround about this? 

And, Happy New Year 2021, too!!! 

[Lestrades.com] Nao 尚

  • I'm Share-Locked
  • Administrator
  • Posts: 1,349
  • Trades: 217
Re: What's up at Lestrade's?
« Reply #787,  »
I see what you mean, now. For some reason, I thought the LT user name was taken from the Steam user name. It is not.
Thing is, Lestrade's doesn't store Steam user names at all, it gets the Steam ID through the API, and then stores that.
When logging in, one of the response elements has the proper ID in it. That's what I store, and then I move onto other things.
I'm sorry that I can't help in this regard.
I could, ideally, add some code to turn a Steam user name into a Steam ID on the fly, by doing a request internally, but it'd imply doing some exchanges between LT and the Steam server, and as you know, there's a limit to how much I can do per day, so if someone decided to write a quick script to request a Steam ID from a random, non-existent Steam user name, they might be able to get Steam to softban Lestrade's for a while, and make it work less reliably.
What I'd suggest is to look into your own side, see if there's a way to get an ID from a user name, perhaps with some quick Ajax code. I could even help you with that, if you're not sure how to do it.

AJ

  • Newbie
  • Posts: 21
  • Trades: 3
Re: What's up at Lestrade's?
« Reply #788,  »
Thanks for the tips and I definitely need and welcome any help!

But I'm not sure I understand your first two paragraphs above.  My question is:  Since the LT's already get the Steam user ID in the first place and store them in the LT's server, why not just put it on the URL of the LT's instead of the inconsistent user names?  And why would this make LT's less reliably?

And about getting the Steam user ID, do you have any experience with Steam API, e.g. to retrieve the Steam users' data(ID, library...etc), games info, and market items info?  I really want to learn it.  Any suggestion for a good place to start from?

[Lestrades.com] Nao 尚

  • I'm Share-Locked
  • Administrator
  • Posts: 1,349
  • Trades: 217
Re: What's up at Lestrade's?
« Reply #789,  »
There are urls I believe you can simply call to get the info you need, no need to get an API key etc, but I'd need to look into that.

As for showing a custom user name instead of a steam id, that's because Lestrade's uses the wedge codebase and, even though I wrote that as well, it'd take a long time to rewrite that and there's no real reason for me to do it, since it's also convenient to allow users to change their user name here.