From 49d64d40c6381e0229604cc1b88eadfc56a5f2f4 Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Fri, 27 Sep 2024 13:32:23 +0200 Subject: [PATCH] update for 2024 worlds --- .env.example | 1 + main.py | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..d5cd81f --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +CALENDAR_ID= \ No newline at end of file diff --git a/main.py b/main.py index 84f2eaa..14b70f9 100755 --- a/main.py +++ b/main.py @@ -36,7 +36,7 @@ class Match: if self.stage == "Swiss": if self.roundName in ["Round 1", "Round 2"]: return 1 - if self.roundName == "Round 3" and self.time.day == 22: + if self.roundName == "Round 3" and self.time.day == 6: return 1 return 3 if self.stage == "Knockout": @@ -94,9 +94,8 @@ class Match: def fetch_matches(): sources = [ - "https://lol.fandom.com/wiki/2023_Worlds_Qualifying_Series", - "https://lol.fandom.com/wiki/2023_Season_World_Championship/Play-In", - "https://lol.fandom.com/wiki/2023_Season_World_Championship/Main_Event" + "https://lol.fandom.com/wiki/2024_Season_World_Championship/Play-In", + "https://lol.fandom.com/wiki/2024_Season_World_Championship/Main_Event" ] stages = ["Play-In", "Swiss", "Knockout"] @@ -114,7 +113,7 @@ def fetch_matches(): raw_matches: list[Tag] = match_list.find_all(attrs={"class", "ml-row"}) # somehow identify stage... - stage = stages[0] if (src == sources[0] or src == sources[1]) else \ + stage = stages[0] if (src == sources[0]) else \ (stages[1] if "Round" in roundName else stages[2]) for raw_match in raw_matches: @@ -152,8 +151,8 @@ def fetch_matches(): def get_calendar_events(): api = get_service() - start = "2023-04-01T00:00:00Z" - end = "2023-11-20T00:00:00Z" + start = "2024-04-01T00:00:00Z" + end = "2024-12-01T00:00:00Z" calendarId = os.environ.get("CALENDAR_ID") events = api.events().list( calendarId=calendarId, timeMin=start, timeMax=end,