seriouslysean / monster-hunter-now-events

A tool that auto-generates calendar events for Monster Hunter Now by scraping web news articles, processing them with AI, and creating a convenient calendar subscription.
https://seriouslysean.github.io/monster-hunter-now-events/
MIT License
8 stars 9 forks source link

[Feature]: Do not save events.json on error #46

Open seriouslysean opened 8 months ago

seriouslysean commented 8 months ago

Feature Description

Saving events.json with an empty array of events stops it from redownloading or trying again in the future.

lunethefirst commented 7 months ago

@seriouslysean - I've been poking around at this, it looks as simple as a conditional bailing early if the .events array is empty. Is the check you are thinking of after the ChatGPT request responds? Do you have recommended steps for verifying this feature is working as desired?

seriouslysean commented 7 months ago

You should be able to just run npm start twice, once to pull the data, then again to make sure it noops properly.

There’s already a check for the hash when merging the fixtures so after gpt makes sense. I’m imagining a dupe event which then sometimes do, where we get a new entry in the fixture but gpt sends back the same response.

It’s really tricky because GPT may never convince events or dedupe them in the same way.