diff --git a/foodie_automator_rss.py b/foodie_automator_rss.py index 9809b65..2de6b0f 100644 --- a/foodie_automator_rss.py +++ b/foodie_automator_rss.py @@ -46,6 +46,15 @@ RATE_LIMIT_DELAY = 1 # Delay between API calls in seconds FEED_TIMEOUT = 30 # Timeout for feed requests in seconds MAX_RETRIES = 3 # Maximum number of retries for failed requests +POSTED_TITLES_FILE = '/home/shane/foodie_automator/posted_rss_titles.json' +USED_IMAGES_FILE = '/home/shane/foodie_automator/used_images.json' +EXPIRATION_HOURS = 24 +IMAGE_EXPIRATION_DAYS = 7 + +posted_titles_data = load_json_file(POSTED_TITLES_FILE, EXPIRATION_HOURS) +posted_titles = set(entry["title"] for entry in posted_titles_data) +used_images = set(entry["title"] for entry in load_json_file(USED_IMAGES_FILE, IMAGE_EXPIRATION_DAYS) if "title" in entry) + def setup_logging(): """Configure logging with rotation and cleanup.""" if os.path.exists(LOG_FILE):