JSON for Race Results?

Post anything about MX Simulator here. Please. I'm begging you.
Post Reply
DBRider251
Posts: 1929
Joined: Fri Jun 21, 2013 5:38 pm
Team: Elevated Motorsports

JSON for Race Results?

Post by DBRider251 »

JLV would be the one to know, but posting in case anyone else knows as well.

Is there JSON data of each race result that's stored somewhere? I know there is track records of each stored like this http://mxsimulator.com/servers/elsinore ... ecords_all but was wondering if the individual races were.

I'm working on a project for school that I may be able to translate over to MXS if there is. Haven't looked too hard honestly, just curious if there was before I dug.
TeamHavocRacing wrote:it's all the liberals fault
jlv
Site Admin
Posts: 14913
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: JSON for Race Results?

Post by jlv »

No. The individual races are in the server results format. There are a lot of results that have to be stored and the server format is more compact than JSON.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
baker
Posts: 283
Joined: Sat Jul 30, 2011 1:43 pm

Re: JSON for Race Results?

Post by baker »

jlv wrote: Wed Feb 17, 2021 3:54 am No. The individual races are in the server results format. There are a lot of results that have to be stored and the server format is more compact than JSON.
DBRider251 wrote: Wed Feb 17, 2021 3:09 am JLV would be the one to know, but posting in case anyone else knows as well.

Is there JSON data of each race result that's stored somewhere? I know there is track records of each stored like this http://mxsimulator.com/servers/elsinore ... ecords_all but was wondering if the individual races were.

I'm working on a project for school that I may be able to translate over to MXS if there is. Haven't looked too hard honestly, just curious if there was before I dug.
I'm not recommending this as I don't know how jlv would feel about scraping the html on race result pages, but this script seems to parse the server results format, then print out the rows/columns as html. I know it could be repurposed to build json objects.

https://mxsimulator.com/racestats.js

You could also just scrape the tables themselves without trying to use this script, but again, don't know how jlv would feel about scraping the pages or the load it could put on the server if you try to fetch/parse a bunch of pages.
DBRider251
Posts: 1929
Joined: Fri Jun 21, 2013 5:38 pm
Team: Elevated Motorsports

Re: JSON for Race Results?

Post by DBRider251 »

baker wrote: Thu Mar 11, 2021 5:28 pm I'm not recommending this as I don't know how jlv would feel about scraping the html on race result pages, but this script seems to parse the server results format, then print out the rows/columns as html. I know it could be repurposed to build json objects.

https://mxsimulator.com/racestats.js

You could also just scrape the tables themselves without trying to use this script, but again, don't know how jlv would feel about scraping the pages or the load it could put on the server if you try to fetch/parse a bunch of pages.
I seen that, but I just moved to a python scraper. It gave me the information needed, and I only scrape when I make a request to make the stats for that race. I don't think it would be too bad.
TeamHavocRacing wrote:it's all the liberals fault
baker
Posts: 283
Joined: Sat Jul 30, 2011 1:43 pm

Re: JSON for Race Results?

Post by baker »

DBRider251 wrote: Fri Mar 12, 2021 3:07 am
baker wrote: Thu Mar 11, 2021 5:28 pm I'm not recommending this as I don't know how jlv would feel about scraping the html on race result pages, but this script seems to parse the server results format, then print out the rows/columns as html. I know it could be repurposed to build json objects.

https://mxsimulator.com/racestats.js

You could also just scrape the tables themselves without trying to use this script, but again, don't know how jlv would feel about scraping the pages or the load it could put on the server if you try to fetch/parse a bunch of pages.
I seen that, but I just moved to a python scraper. It gave me the information needed, and I only scrape when I make a request to make the stats for that race. I don't think it would be too bad.
Baller, sounds like that will do the trick. I don’t think individually scraping pages on an as needed basis is bad at all. Exactly the same as loading the page in the browser.
Post Reply