Compare commits

..

No commits in common. "2cccac4aa798f501466b1537302abdf99648b02a" and "c115999e77498419d9c7cfc852c82f0b2258d6ff" have entirely different histories.

3 changed files with 712 additions and 1013 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -134,9 +134,8 @@ async def get_events(
async def scrape(client: httpx.AsyncClient) -> None:
cached_urls = CACHE_FILE.load()
valid_urls = {k: v for k, v in cached_urls.items() if v["url"]}
valid_count = cached_count = len(valid_urls)
urls.update(valid_urls)
cached_count = len(cached_urls)
urls.update(cached_urls)
log.info(f"Loaded {cached_count} event(s) from cache")
@ -184,13 +183,13 @@ async def scrape(client: httpx.AsyncClient) -> None:
"link": ev["link"],
}
if url:
valid_count += 1
urls[key] = entry
cached_urls[key] = entry
urls[key] = cached_urls[key] = entry
await browser.close()
if new_count := valid_count - cached_count:
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")