update real time rate limiting checks for X
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user