From a361dd4acccbd49a9a0f8dfd6c61e66e5cab43fe Mon Sep 17 00:00:00 2001 From: Sergey Melekhin Date: Sat, 2 Dec 2023 21:05:36 +0700 Subject: [PATCH 1/2] aoc forever --- bot/skills/aoc_mode.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bot/skills/aoc_mode.py b/bot/skills/aoc_mode.py index 07e2378..6c5e7c6 100644 --- a/bot/skills/aoc_mode.py +++ b/bot/skills/aoc_mode.py @@ -18,8 +18,16 @@ logger = logging.getLogger(__name__) -AOC_ENDPOINT = "https://adventofcode.com/2022/leaderboard/private/view/458538.json" -AOC_START_TIME = datetime.fromtimestamp(1669870800) + +AOC_ENDPOINT = f"https://adventofcode.com/{datetime.utcnow().year}/leaderboard/private/view/458538.json" +AOC_START_TIME = datetime.utcnow().replace( + year=datetime.utcnow().year, + month=12, + day=1, + hour=5, + minute=0, + second=0, + microsecond=0).timestamp() AOC_UPDATE_INTERVAL = timedelta(minutes=15) JOB_AOC_UPDATE = "aoc_update_job" From f68cf7edb15170d3bf666b1c25884330e7141da7 Mon Sep 17 00:00:00 2001 From: Sergey Melekhin Date: Sat, 2 Dec 2023 21:09:18 +0700 Subject: [PATCH 2/2] format --- bot/skills/aoc_mode.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bot/skills/aoc_mode.py b/bot/skills/aoc_mode.py index 6c5e7c6..b27c51c 100644 --- a/bot/skills/aoc_mode.py +++ b/bot/skills/aoc_mode.py @@ -20,14 +20,19 @@ AOC_ENDPOINT = f"https://adventofcode.com/{datetime.utcnow().year}/leaderboard/private/view/458538.json" -AOC_START_TIME = datetime.utcnow().replace( - year=datetime.utcnow().year, - month=12, - day=1, - hour=5, - minute=0, - second=0, - microsecond=0).timestamp() +AOC_START_TIME = ( + datetime.utcnow() + .replace( + year=datetime.utcnow().year, + month=12, + day=1, + hour=5, + minute=0, + second=0, + microsecond=0, + ) + .timestamp() +) AOC_UPDATE_INTERVAL = timedelta(minutes=15) JOB_AOC_UPDATE = "aoc_update_job"