|
|
|
@ -1201,8 +1201,8 @@ def prepare_post_data(summary, title, main_topic=None): |
|
|
|
|
|
|
|
|
|
|
|
pixabay_url = page_url if image_source == "Pixabay" else None |
|
|
|
pixabay_url = page_url if image_source == "Pixabay" else None |
|
|
|
|
|
|
|
|
|
|
|
authors = ["Aisha Patel", "Ravi Sharma", "Mei Lin", "Carlos Rivera"] |
|
|
|
# Select a full author dictionary from AUTHORS (already imported from foodie_config) |
|
|
|
author = random.choice(authors) |
|
|
|
author = random.choice(AUTHORS) |
|
|
|
|
|
|
|
|
|
|
|
categories = ["Food", "Trends", "Eats", "Culture"] |
|
|
|
categories = ["Food", "Trends", "Eats", "Culture"] |
|
|
|
category = random.choice(categories) |
|
|
|
category = random.choice(categories) |
|
|
|
@ -1211,11 +1211,11 @@ def prepare_post_data(summary, title, main_topic=None): |
|
|
|
"title": new_title, |
|
|
|
"title": new_title, |
|
|
|
"content": summary, |
|
|
|
"content": summary, |
|
|
|
"status": "publish", |
|
|
|
"status": "publish", |
|
|
|
"author": author, |
|
|
|
"author": author["username"], # Use the username in post_data |
|
|
|
"categories": [category] |
|
|
|
"categories": [category] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
logging.info(f"Post data prepared: Title: '{new_title}', Category: {category}, Author: {author}") |
|
|
|
logging.info(f"Post data prepared: Title: '{new_title}', Category: {category}, Author: {author['username']}") |
|
|
|
return post_data, author, category, image_url, image_source, uploader, pixabay_url |
|
|
|
return post_data, author, category, image_url, image_source, uploader, pixabay_url |
|
|
|
|
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
|