Jump to content

Archived

This topic is now archived and is closed to further replies.

Webservice data sources for leagues/events?

Recommended Posts

Think I remember someone getting hold of the data sources for leagues and events sometime earler, but I can't find the post.

What I'm after are rest/soap data sources, primarily for leagues. I'd like to get and present results and present statistics per stage, and maybe even my own point tracker (with definable "power stage"). All of which would be quite easy if I could get the data in a reasonably easy way. I could potentially start digging in the javascript code for the league pages and find the data sources, but feels like a real hassle if the data sources are already available :-)

So, does anyone have some knowledge to share? Or maybe @Hatward or @KickUp could point me in the right direction?

Share this post


Link to post
Share on other sites
If something like this: http://cars-stats-steam.wmdportal.com/index.php/leaderboard?track=1408845203&vehicle=844159614 would be possible to create, would be really awesome as well.

Share this post


Link to post
Share on other sites
Here is a C# example on how to query the API and parse the JSON result: https://github.com/aarondemarre/DRLeagueParser/blob/master/DRLPTest/RacenetApiParser.cs

I have yet to build a version that does championship points handling (but that was the end goal, eventually), this tool started as a way to get stage times since that is not available on Racenet. Also if you have the event ID, you can get results for a rally after the season has completed and is no longer available on the Racenet site, which is an absolute lifesaver for a league admin.

The full project is here, I have not built a release version in some time, I will do that today if someone just wants to use the tool. Otherwise the code is licensed under MIT, aka: do whatever you want with it. :smile:

https://github.com/aarondemarre/DRLeagueParser

Some examples on what I do with the CSV output from the tool
Overall results: http://i.imgur.com/5gdbVi5.png
Position chart: http://i.imgur.com/QpOHgmx.png
Stage results: http://cmsracing.com/champion/forums/cms-dirt-rally-league-102/cms-drcc-s3e3-greece-29967/index2.html#post221577

Share this post


Link to post
Share on other sites
Awesome @enamel! I'll dig right in and see what I can do with it :-)

Share this post


Link to post
Share on other sites
Contact /Th3HolyMoose from reddit.
He created THIS very decent tool to integrate daily and weekly results for DR across platforms.
It works for reddit league so it will work for others too. And you can select each stage on its own and compare.
And you also find the source code on this link.

Hope this helps!

Share this post


Link to post
Share on other sites
I've also been fiddling with some (PowerShell) code for some time, hoping to find a use for it one day (something for the DRC league has been in the back of my mind). As of now it's about 10-12 different functions that pull various types of data from racenet/dirtgame.com, either through rest, html-parsing or a combination of the two (as some required info is found in the page source, e.g. weather conditions for stages).
Unfortunately, I haven't published my code (yet) but give me a shout in a PM or on Steam and I'll be happy to share what I've got so far.

Share this post


Link to post
Share on other sites
Well any digging you've already done would be helpful :-)

enamels url has the event/stage info, but if you've found a way to get league info through a rest call it'd be great. Much more handy than parsing web pages, especially since web pages has a tendency to change :-) 

I thought I'd make some real simple javascript thingy that stores a bit of data in some lightweight db just for the fun of it, and see if I can make powerstage points for the DRC. Just a pet projekt but if it works decently I'll releast it to the public :-)

Share this post


Link to post
Share on other sites
I would love a way to get league data from the REST API. I looked at it briefly, but never saw any http calls to fetch this data and assumed getting league data was a server side operation.

Share this post


Link to post
Share on other sites
Soo...

Just to document stuff:

League leaderboards:
https://www.dirtgame.com/uk/leagues/league-leaderboard.json?teamId=39043

Event info:
https://www.dirtgame.com/uk/api/event?assists=any&eventId=157627&group=all&leaderboard=true&nameSearch=&noCache=1463699433315&number=100&page=1&stageId=1&wheel=any

Anyone found how to get a list of events for a league by REST calls? Or is it time to resort to good old-fashioned html parsing?

Share this post


Link to post
Share on other sites
If something like this: http://cars-stats-steam.wmdportal.com/ would be possible to create, would be really awesome as well.
From what I've seen so far, creating something similar for the overall best times per stage/weather combination should be possible. It would compare classes, though, not individual cars (don't think that info is available).

What I'd also like is to have a full history of all my stage times, not just personal best, e.g. make it available as a download from your profile page (any structured format, only available to you). It would've been interesting to see my progress since I first started playing, but I doubt that information has been retained.

@Dytut: I've started to gather the sources I've come across so far, but it will take some time as I want to document a few of them. As for the league events (i.e. full schedule); I haven't seen a REST call for these, but they are available through html-parsing.

Share this post


Link to post
Share on other sites
Track times I've found so far:

curl -H "Content-Type: application/json" -X POST -d "{playerId: "1463872", trackId: "511", vehicleClassId: 77, conditions: "0", versusId: 0}" https://www.dirtgame.com/us/api/lap-times

But is only the data output same as the profile, with just the 10 second intervals :-/

Share this post


Link to post
Share on other sites
baunau said:
If something like this: http://cars-stats-steam.wmdportal.com/ would be possible to create, would be really awesome as well.
From what I've seen so far, creating something similar for the overall best times per stage/weather combination should be possible. It would compare classes, though, not individual cars (don't think that info is available).
Yea classes would be fine, that's how it's shown ingame as well. I guess there is no way of linking racenet profiles to steam id's easily? That way it would be possible to filter those lists on your steam friends etc.
Dytut said:
Track times I've found so far:

curl -H "Content-Type: application/json" -X POST -d "{playerId: "1463872", trackId: "511", vehicleClassId: 77, conditions: "0", versusId: 0}" https://www.dirtgame.com/us/api/lap-times

But is only the data output same as the profile, with just the 10 second intervals :-/

Yea this isn't much useful data unfortunately. 
@Hatward can you maybe help us out or point us in the right direction on this one?

Share this post


Link to post
Share on other sites
Proof of concept in php works at least, can get live parsing of everything important for a league page where I could potentially calculate points and power stages. The initial HTML parsing is slow as hell, but once I've made that save in a local database it ought to be pretty quick. 

Share this post


Link to post
Share on other sites

×