This commit is contained in:
doms9 2025-12-18 04:14:54 -05:00
parent 8b2d8cc1fc
commit 00000d939c
20 changed files with 119 additions and 12 deletions

View file

@ -52,7 +52,9 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
continue
sport = sport_node.text(strip=True)
team_1_node = card.css_first(".team1 .team-name")
team_2_node = card.css_first(".team2 .team-name")
if team_1_node and team_2_node:
@ -88,7 +90,9 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
async def scrape() -> None:
cached_urls = CACHE_FILE.load()
cached_count = len(cached_urls)
urls.update(cached_urls)
log.info(f"Loaded {cached_count} event(s) from cache")
@ -146,6 +150,7 @@ async def scrape() -> None:
if new_count := len(cached_urls) - cached_count:
log.info(f"Collected and cached {new_count} new event(s)")
else:
log.info("No new events found")