The online racing simulator
Aaah ok, thanks for the response Dygear, guess I shall just have to wait and keep my fingers crossed.
Well, you could retrieve the wr alongside with the racername (which is provided) and afterwards do a seperate query on all that racer's hotlaps (?action=hl), where you pick out the one for your desired track/car, as there is a timestamp there.
Of course his produces an additional query for each wr (or at least each wr that is done by one, who didn't do another one), so it would be considerable keeping track of wrs and only fetching the timestamp, when one is changed ...
I had looked into doing it that way avetere.
The way I'm implementing the comparison between PB and WR is by downloading the relevant data, processing it into a text file (one for the players PB and another for the WR list and saving them for future use, with options to update the data) extracting the relevant information from the pre-processed data, calculate the time difference and displaying. Doing it this way means I can show the info instantly(more or less), without imposing any delay for the user by retrieving data "live". It also means the app can be used "offline".
Thankyou avetere for "reminding" me of that method.
I shall have a little play around and see what I can conjure up.

P.s. I'm doing this as a learning project, trying to keep the old brain firing on all cylinders.
I'm doing some pubstat updates and will soon update to version 1.5

The current changes are :
v1.4 => v1.5
------------
NEW ?action=counters - get global car/track lapcount
?action=wr - added timestamp
?action=ch - added optional country filter

These already work, but only if you indicate with &version=1.5

If you have any feature requests, then please ask for them now. Otherwise I'll update to v1.5 tomorrow.
Well, what I would really like is:
- have action=fuel combined with action=pb, thus having both datasets with a single query
- have action=pb altered in a way, that outdated PBs are returned with their actual times instead of giving all zeros (perhaps have an "outdated flag" somewhere) as it can be seen on lfsworld


A real kickass-feature (though I doubt it would be implemented, but one should be allowed to dream) would be:
give pubstat an array of racers and fetch, whether they have done any laps (maybe even on a particular set of car/track combos) within a set threshold,
thus enabling one to update his/her database only, when it is neccessary.
(This would for example avoid me to fetch the hostlist every 2 minutes just to see, if any of the racers might need an update.)

Or (even more dreaming): Have only PB-data (PB and laps) of a racer gained up to a specific date (Though I'm quite sure, this won't be possible as it requires to store a racers pb-history (which would actually be veeeeeeeery cool))

... well ideally I'd take a combination of all of that ... as to be realistic, I think the first two could be worth a try anyway

thanks in advance ...
Thankyou Victor, the new ?actions work nicely
I would also like to second avetere's idea of combining PB and FUEL usage requests into one call (if possible).
Just got another idea:
How about a history of laps driven by a racer (giving a list containing server, track, car, laptime and timestamp for within some time from the query - say a day or 12 hours or so)
Just if it is possible that is ...


Oh, btw:
For some days each morning around 6am (CET) I'll get this from pubstat:
<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>

Can't tell, if it's a bug or a feature ... so I'd appreciate a comment
At 6am CET a database backup is done. But this takes a few minutes and (unfortunately) systems stall a bit then.
So it's normal in the sense that it's known. Can't really do anything about it though afaik. Not easily anyway.
OK fine! I imagined something of the kind ... just wanted to ensure though, thanks!
Quote from avetere :Have action=fuel combined with action=pb, thus having both datasets with a single query

Agreed.

Quote from avetere :have action=pb altered in a way, that outdated PBs are returned with their actual times instead of giving all zeros (perhaps have an "outdated flag" somewhere) as it can be seen on lfsworld

No opinion right now really, but it can't hurt.

Quote from avetere :give pubstat an array of racers and fetch, whether they have done any laps (maybe even on a particular set of car/track combos) within a set threshold.

Yes, yes, yes! Although, this might get ugly to parse in anything other then a XML / sterilized format, it's a pretty awesome idea. The URL does allow you to send arrays to it via the &var[]= method, and you can even lable what you want to go where. So for example, &racer[1]=Dygear&racer[2]=avetere&cars[1][]=FXO&cars[1][]=FOX&cars[2][]=MRT&cars[2][]=BF1 making it really easy for Victor to parse. Although I'm pretty sure that the URL limit is like 355 charters, so you might hit that on a larger query.

Quote from avetere :Or (even more dreaming): Have only PB-data (PB and laps) of a racer gained up to a specific date (Though I'm quite sure, this won't be possible as it requires to store a racers pb-history (which would actually be veeeeeeeery cool))

Can't hurt, although I would prefer that this option would be standard across the board.
Quote from Dygear :Although I'm pretty sure that the URL limit is like 355 charters, so you might hit that on a larger query.

Seems to me, IE with just above 2000 characters is the limiting factor (or was, not sure, how it is now with the new versions) as servers seem to be able to cope with those lengths:
http://www.boutell.com/newfaq/misc/urllength.html
Oh, just one more thing:
How about giving the textfile with all those options (basically those on post 1), if no or maybe "help" action is requested? that one maybe even without pubstat-key?

And I'd appreciate a list of all the error-messages (maybe as action=errorcodes ?)
Quote from avetere :Oh, just one more thing:
How about giving the textfile with all those options (basically those on post 1), if no or maybe "help" action is requested? that one maybe even without pubstat-key?

And I'd appreciate a list of all the error-messages (maybe as action=errorcodes ?)

I have a list of error messages within the LFSWorldSDK, your more then welcome to use the code from there in part or in whole as it's released under the MIT license.
Will have a look at it (had downloaded it even earlier but forgotten about it somehow :shrug.
Nevertheless, I'd appreciate an official list, as you are missing at least one of those in your file (see your thread) and god knows how many we haven't sumbled upon ...
Quote from Dygear :Although, this might get ugly to parse in anything other then a XML / sterilized format

Sat in the ambo a bit long again have we? :P

Quote from Dygear :Although I'm pretty sure that the URL limit is like 355 charters, so you might hit that on a larger query.

for what it's worth, the maximum length the web server will allow is around 4000 bytes.

But I don't think i'm going to implement this (now) tbh.

I've done the pb+fuel now though. Looking at the other requests now.

I've no pb history data btw, so i can't display that.
Quote from Victor :Sat in the ambo a bit long again have we? :P

Yeah, the diesel fumes are starting to go to my head.

Quote from Victor :for what it's worth, the maximum length the web server will allow is around 4000 bytes.P

But I don't think i'm going to implement this (now) tbh.P

I understand, that would be quite a bitch to implement.

Quote from Victor :I've done the pb+fuel now though. Looking at the other requests now.P

Thank you.

Quote from Victor :I've no pb history data btw, so i can't display that.

No problem, thank you.
Victor, out of interest, do you happen to have a record of all of the hotlaps ever uploaded to LFS World?
well, there's the hl_log data. I started recording that on 21 Dec 2007. So it's not _all time_, but quite some time. 135000 entries.
Ah sweet. I might like to get that from you some time in the future if possible.
There is on more thing that has nothing to do with LFS World stats. Make LFSWorld / LFS an OpenID provider. It would greatly help the next community vote, it would also help 3rd party websites authenticate that clients are who they say they are.
pubstat has been updated to v1.5 now.

v1.4 => v1.5
------------
NEW ?action=counters - get global car/track lapcount
NEW ?action=help - displays the full pubstat help text (omitting ?action will do the same)
?action=wr - added timestamp
?action=ch - added optional country filter
?action=teams - added optional team filter to search for only one team instead of downloading the whole list
?action=pb - added fuel data (Given in % of tank capacity)

Complete info can be found in the first post of this thread.
Thanks again Victor
Quote from Victor :
?action=ch - added optional country filter
?action=teams - added optional team filter to search for only one team instead of downloading the whole list

very nice!
Would have liked to see those outdated times on pb, but nevertheless:
Nice one, thank you!


A few notes though:
Quote :NEW ?action=help - displays the full pubstat help text (omitting ?action will do the same)

This will now happen any time, an idk is omitted or false instead of giving the appropriate error-message (which I believe is a bug)

Quote :Version numbers
---------------------
Since v1.1, Version numbers have been introduced, to make future updates easier while not having to disrupt your existing scripts. If you were already running a script, you don't have to change anything, unless you want to make use of the new features that come with the latest versions.
The current version is v1.4

Well ... this should be 1.5 by now
Quote from avetere :A few notes though:
This will now happen any time, an idk is omitted or false instead of giving the appropriate error-message (which I believe is a bug)

I cannot reproduce this. Are you sure you didn't just omit the &action variable?

In my code I do this check (for action=help or action omitted) before I do anything else, so it can't really be that a wrong idk shows the help. It's unrelated.

FGED GREDG RDFGDR GSFDG