PDA

View Full Version : Who runs cars2-stats-steam-leaderboard?



Maskmagog
18-11-2018, 18:49
I'm keeping myself busy with a leaderboard project, and it involves scraping cars2-stats-steam.wmdportal.com. Just realized that the "Overall best" times on the website isn't the overall best times. Seems like it's the overall best times in GT classes only, from GT1 down to G40 Junior.
Anybody knows why?

Maskmagog
02-12-2018, 20:29
I have a python script working beautifully, that gets complete leaderboards for selected car-track combos off the cars2-stats-page. But 2 cars throws a KeyError in Python. Don't know why. It's the Ford Escort RS1600 Racing (id=3679780595), and the standard Ford Escort 1600 (id=1639105598). All other cars I've tried have worked.

Does anyone have a clue? I've doublechecked the id's, they match with what's on cars2-stats-steam.wmdportal.com.

Maskmagog
02-12-2018, 20:53
Ok, I think I've found the reason. On the cars2-stats-page, all three Ford Escort 1600 are called just that. While in-game, they have different names, for example Ford Escort 1600 (Racing).
All three of them having the same name makes it hard to know which one's leaderboard you're looking at. Which kinda brings me back to my first question: How can I get in touch with anyone running that site? Is it WMD? SMS?

cpcdem
02-12-2018, 21:00
I assume it's SMS that runs it. Just distinguish them by id, then when you want to display them, use a custom (you're own) different text for each of them. At least this is how the guy at https://pcars.13ms.de/#/times/832629329?vehicle=3679780595 has handled it. Btw, that's not the only car with identical names with another, same thing happens with Audi R18, Ferrari 488 Challenge, the Indy cars and some more.

Maskmagog
02-12-2018, 22:15
Thanks cpcdem, that's what I'm trying to do (use the id). I'm basically using a python scraper by another guy, and as far as I can tell it uses the ID. But you're right, it should be possible.
I'll test the other cars you mentioned and see if it throws the same KeyError. Onwards and upwards.

cpcdem
03-12-2018, 00:50
Thanks cpcdem, that's what I'm trying to do (use the id). I'm basically using a python scraper by another guy, and as far as I can tell it uses the ID. But you're right, it should be possible.
I'll test the other cars you mentioned and see if it throws the same KeyError. Onwards and upwards.

Why don't you post the code here to have a look? I am not personally familiar with python, but if it's something obvious I think I'll see it. Or someone else will step in with a suggestion.

satco1066
03-12-2018, 06:50
can't you sniff the traffic. Its not HTTPS, so it should be no problem

Maskmagog
03-12-2018, 08:10
Thanks, I've emailed the author of the scraper script. He's a fellow Swede and has helped me before. As cpcdem pointed out, others can do it, so it's possible.