update double tweet & other scripts to new code

This commit is contained in:
2025-05-04 16:15:20 +10:00
parent 4116d5f742
commit 61b3de52a2
4 changed files with 27 additions and 7 deletions
+5 -1
View File
@@ -38,7 +38,11 @@ def filter_posts_for_week(posts, start_date, end_date):
return filtered_posts
def generate_intro_tweet(author):
author_handle = author["handle"]
credentials = next((cred for cred in X_API_CREDENTIALS if cred["username"] == author["username"]), None)
if not credentials:
logging.error(f"No X credentials found for {author['username']}")
return None
author_handle = credentials["x_username"]
prompt = (
f"Generate a concise tweet (under 280 characters) for {author_handle}. "
f"Introduce a thread of their top 10 foodie posts of the week on InsiderFoodie.com. "