Shane 7 months ago
parent c4e01d3d63
commit 110346064f
  1. 10
      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

Loading…
Cancel
Save