Shane 7 months ago
parent 7fba0fe96a
commit d2022222c3
  1. 8
      foodie_utils.py

@ -1201,8 +1201,8 @@ def prepare_post_data(summary, title, main_topic=None):
pixabay_url = page_url if image_source == "Pixabay" else None
authors = ["Aisha Patel", "Ravi Sharma", "Mei Lin", "Carlos Rivera"]
author = random.choice(authors)
# Select a full author dictionary from AUTHORS (already imported from foodie_config)
author = random.choice(AUTHORS)
categories = ["Food", "Trends", "Eats", "Culture"]
category = random.choice(categories)
@ -1211,11 +1211,11 @@ def prepare_post_data(summary, title, main_topic=None):
"title": new_title,
"content": summary,
"status": "publish",
"author": author,
"author": author["username"], # Use the username in post_data
"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
except Exception as e:

Loading…
Cancel
Save