update real time rate limiting checks for X

This commit is contained in:
2025-05-08 16:27:10 +10:00
parent 01bab56eb6
commit 447bfb0087
7 changed files with 284 additions and 195 deletions
+10 -4
View File
@@ -272,6 +272,16 @@ def curate_from_google_trends(posted_titles_data, posted_titles, used_images_dat
attempts += 1
continue
# Check author availability before GPT calls
author = get_next_author_round_robin()
if not author:
logging.info(f"Skipping trend '{title}' due to tweet rate limits for all authors")
attempts += 1
continue
author_username = author["username"]
logging.info(f"Selected author via round-robin: {author_username}")
logging.info(f"Trying Google Trend: {title} from {source_name}")
try:
@@ -319,10 +329,6 @@ def curate_from_google_trends(posted_titles_data, posted_titles, used_images_dat
final_summary = insert_link_naturally(final_summary, source_name, link)
author = get_next_author_round_robin()
author_username = author["username"]
logging.info(f"Selected author via round-robin: {author_username}")
post_data = {
"title": generate_title_from_summary(final_summary),
"content": final_summary,