From 36162a81d82b92e15fe6ee395357b6b802e9b7f5 Mon Sep 17 00:00:00 2001 From: Daniel Nowak <13685818+lowlyocean@users.noreply.github.com> Date: Sun, 6 Jan 2019 11:01:53 -0500 Subject: [PATCH] Add last_series() for race-info app --- ir_webstats/client.py | 8 ++++++++ ir_webstats/constants.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ir_webstats/client.py b/ir_webstats/client.py index 09d8500..d26b6cb 100644 --- a/ir_webstats/client.py +++ b/ir_webstats/client.py @@ -392,6 +392,14 @@ def all_seasons(self): pprint("Getting iRacing Seasons with Stats") resp = self.__req(ct.URL_SEASON_STANDINGS2) return self._load_irservice_var("SeasonListing", resp) + + def last_series(self, userid): + """ Returns stats for the last 3 series the driver has raced in """ + + r = self.__req(ct.URL_LAST_SERIES % userid) + res = parse(r) + + return res @logged_in def season_standings(self, season, carclass, club=ct.ALL, raceweek=ct.ALL, diff --git a/ir_webstats/constants.py b/ir_webstats/constants.py index a08edca..af9a114 100644 --- a/ir_webstats/constants.py +++ b/ir_webstats/constants.py @@ -57,8 +57,9 @@ URL_SELECT_SERIES = 'https://members.iracing.com/membersite/member/SelectSeries.do?&season=%s&view=undefined&nocache=%s' URL_SESSION_TIMES = 'https://members.iracing.com/membersite/member/GetSessionTimes' # T-m-d URL_SERIES_RACERESULTS = 'https://members.iracing.com/memberstats/member/GetSeriesRaceResults' +URL_LAST_SERIES = 'https://members.iracing.com/memberstats/member/GetLastSeries?custid=%s' -URL_GET_EVENTRESULTS = 'http://members.iracing.com/membersite/member/GetEventResultsAsCSV?subsessionid=%s&simsesnum=%s&includeSummary=1' #simsesnum 0 race, -1 qualy or practice, -2 practice +URL_GET_EVENTRESULTS = 'https://members.iracing.com/membersite/member/GetEventResultsAsCSV?subsessionid=%s&simsesnum=%s&includeSummary=1' #simsesnum 0 race, -1 qualy or practice, -2 practice