From 110346064f99577c88900c3762884c51bb55f3c7 Mon Sep 17 00:00:00 2001 From: Shane Date: Wed, 7 May 2025 14:06:02 +1000 Subject: [PATCH] try --- foodie_engagement_tweet.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/foodie_engagement_tweet.py b/foodie_engagement_tweet.py index 073e0f3..99d07fc 100644 --- a/foodie_engagement_tweet.py +++ b/foodie_engagement_tweet.py @@ -393,6 +393,16 @@ def post_engagement_tweet(): post_counts.append(author_count) save_post_counts(post_counts) + if author_count["month"] != datetime.now(timezone.utc).strftime("%Y-%m"): + logging.info(f"Resetting monthly count for {username} due to new month") + author_count["month"] = datetime.now(timezone.utc).strftime("%Y-%m") + author_count["monthly_count"] = 0 + + if author_count["day"] != datetime.now(timezone.utc).strftime("%Y-%m-%d"): + logging.info(f"Resetting daily count for {username} due to new day") + author_count["day"] = datetime.now(timezone.utc).strftime("%Y-%m-%d") + author_count["daily_count"] = 0 + if author_count["monthly_count"] >= 500: logging.warning(f"Monthly post limit (500) reached for {username}, skipping") continue