From 4cf8c0e446835581f8bd8a0bc14689266dde2037 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 25 Feb 2026 23:21:19 -0500 Subject: [PATCH] Make current year param default --- util/scrape.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/util/scrape.py b/util/scrape.py index e4ef3e1..9dd6eeb 100644 --- a/util/scrape.py +++ b/util/scrape.py @@ -12,7 +12,7 @@ from bs4 import BeautifulSoup load_dotenv() -def scrape_game_history(game: str, year: int | None = None) -> dict: +def scrape_game_history(game: str, year: int = utils.today().year) -> dict: """ Scrape game data from the url provided. This function requires specific environment variables be present in order to function properly. @@ -30,9 +30,6 @@ def scrape_game_history(game: str, year: int | None = None) -> dict: """ drawings = {} - if year is None: - year = utils.today().year - url = f"{os.getenv('BASE_SCRAPE_URL')}{game}/numbers/{year}" page = httpx.get(url) soup = BeautifulSoup(page.text, 'html.parser')