From b02ec11a13e7e776708b9ea889d9fe004b253778 Mon Sep 17 00:00:00 2001 From: Shane Date: Mon, 21 Apr 2025 15:12:41 +1000 Subject: [PATCH] update posted_rss_titles.json --- foodie_automator_rss.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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):