diff --git a/foodie_automator_google.py b/foodie_automator_google.py index cf007f8..8bd9542 100644 --- a/foodie_automator_google.py +++ b/foodie_automator_google.py @@ -222,6 +222,7 @@ def curate_from_google_trends(geo_list=['US']): f"Generate exactly {num_paragraphs} paragraphs. " f"Do not mention Google Trends, Google, or include any links. " f"Summarize as a standalone food industry trend, focusing on '{title}' and its context." + "Do not include emojis in the summary." ) final_summary = summarize_with_gpt4o( scoring_content, diff --git a/foodie_automator_reddit.py b/foodie_automator_reddit.py index 0b0f244..5c1a6a9 100644 --- a/foodie_automator_reddit.py +++ b/foodie_automator_reddit.py @@ -140,8 +140,8 @@ def is_interesting_reddit(title, summary, upvotes, comment_count, top_comments): def get_top_comments(post_url, reddit, limit=3): try: submission = reddit.submission(url=post_url) + submission.comment_sort = 'top' # Move this line up submission.comments.replace_more(limit=0) - submission.comment_sort = 'top' top_comments = [comment.body for comment in submission.comments[:limit] if not comment.body.startswith('[deleted]')] logging.info(f"Fetched {len(top_comments)} top comments for {post_url}") return top_comments @@ -251,7 +251,8 @@ def curate_from_reddit(): f"FOCUS: Summarize ONLY the provided content, explicitly mentioning '{title}' and sticking to its specific topic and details. " "Incorporate relevant insights from these top comments if available: {', '.join(top_comments) if top_comments else 'None'}. " "Do NOT introduce unrelated concepts unless in the content or comments. " - "If brief, expand on the core idea with relevant context about its appeal or significance." + "If brief, expand on the core idea with relevant context about its appeal or significance. " + "Do not include emojis in the summary." ) content_to_summarize = f"{title}\n\n{summary}" # Use cleaned title if top_comments: diff --git a/foodie_automator_rss.py b/foodie_automator_rss.py index 91554cf..b1d76eb 100644 --- a/foodie_automator_rss.py +++ b/foodie_automator_rss.py @@ -269,6 +269,7 @@ def curate_from_rss(): f"Generate exactly {num_paragraphs} paragraphs. " f"FOCUS: Summarize ONLY the provided content, explicitly mentioning '{title}' and sticking to its specific topic and details. " f"Do NOT introduce unrelated concepts. Expand on the core idea with relevant context about its appeal or significance." + "Do not include emojis in the summary." ) content_to_summarize = scoring_content final_summary = summarize_with_gpt4o( diff --git a/foodie_config.py b/foodie_config.py index bddc936..25ba6c6 100644 --- a/foodie_config.py +++ b/foodie_config.py @@ -108,37 +108,37 @@ SUMMARY_PERSONA_PROMPTS = { "You’re a commanding food editor with a borderless view. Summarize this article in a polished, decisive tone, like shaping a premier food mag, but with a casual twist—think bold vibes like 'This is unreal!'. " "Explore a wide range of food-related topics, skip recipes. Generate exactly {num_paragraphs} paragraphs, 60-80 words each, full thoughts, with a single \n break. " "Write naturally without mentioning the source name or URL directly in the text, with a slight Upworthy/Buzzfeed flair style. " - "Add a bold take and end with a clickbait-y question like Neil Patel would do to boost engagement!" + "Add a bold take and end with a clickbait-y question like Neil Patel would do to boost engagement! Do not include emojis in the summary." ), "Foodie Critic": ( "You’re a seasoned foodie reviewer with a sharp eye. Summarize this article in a pro yet lively tone, like a top food mag with a playful edge—think 'This bangs!'. " "Explore a wide range of food-related topics, skip recipes. Generate exactly {num_paragraphs} paragraphs, 60-80 words each, full thoughts, with a single \n break. " "Write naturally without mentioning the source name or URL directly in the text, with a slight Upworthy/Buzzfeed flair style. " - "Add a subtle opinion and end with a clickbait-y question like Neil Patel would do to boost engagement!" + "Add a subtle opinion and end with a clickbait-y question like Neil Patel would do to boost engagement! Do not include emojis in the summary." ), "Trend Scout": ( "You’re a forward-thinking editor obsessed with trends. Summarize this article in an enthusiastic voice, like 'This is the future, fam!'. " "Explore a wide range of food-related topics, skip recipes. Generate exactly {num_paragraphs} paragraphs, 60-80 words each, full thoughts, with a single \n break. " "Write naturally without mentioning the source name or URL directly in the text, with a slight Upworthy/Buzzfeed flair style. " - "Predict what’s next and end with a clickbait-y question like Neil Patel would do to boost engagement!" + "Predict what’s next and end with a clickbait-y question like Neil Patel would do to boost engagement! Do not include emojis in the summary." ), "Culture Connoisseur": ( "You’re a cultured food writer who loves storytelling. Summarize this article in a warm, reflective tone with a kick, like 'This feels different, right?'. " "Explore a wide range of food-related topics, skip recipes. Generate exactly {num_paragraphs} paragraphs, 60-80 words each, full thoughts, with a single \n break. " "Write naturally without mentioning the source name or URL directly in the text, with a slight Upworthy/Buzzfeed flair style. " - "Add a thoughtful observation and end with a clickbait-y question like Neil Patel would do to boost engagement!" + "Add a thoughtful observation and end with a clickbait-y question like Neil Patel would do to boost engagement! Do not include emojis in the summary." ), "African-American Soul Food Sage": ( "You’re a vibrant storyteller rooted in African-American culinary heritage. Summarize this article in a soulful tone, like 'This got that heat, y’all!'. " "Explore a wide range of food-related topics, skip recipes. Generate exactly {num_paragraphs} paragraphs, 60-80 words each, full thoughts, with a single \n break. " "Write naturally without mentioning the source name or URL directly in the text, with a slight Upworthy/Buzzfeed flair style. " - "Add a heritage twist and end with a clickbait-y question like Neil Patel would do to boost engagement!" + "Add a heritage twist and end with a clickbait-y question like Neil Patel would do to boost engagement! Do not include emojis in the summary." ), "Global Street Food Nomad": ( "You’re an adventurous explorer of global street food. Summarize this article in a bold, gritty tone with a spin, like 'This is straight fire!'. " "Explore a wide range of food-related topics, skip recipes. Generate exactly {num_paragraphs} paragraphs, 60-80 words each, full thoughts, with a single \n break. " "Write naturally without mentioning the source name or URL directly in the text, with a slight Upworthy/Buzzfeed flair style. " - "Drop a street-level insight and end with a clickbait-y question like Neil Patel would do to boost engagement!" + "Drop a street-level insight and end with a clickbait-y question like Neil Patel would do to boost engagement! Do not include emojis in the summary." ) } diff --git a/foodie_utils.py b/foodie_utils.py index 6c2d053..002fbf5 100644 --- a/foodie_utils.py +++ b/foodie_utils.py @@ -812,6 +812,7 @@ def get_flickr_image_via_ddg(search_query, relevance_keywords): response = requests.get(page_url, headers=headers, timeout=10) response.raise_for_status() soup = BeautifulSoup(response.content, 'html.parser') + time.sleep(1) tags_elem = soup.find_all('a', class_='tag') tags = [tag.text.strip().lower() for tag in tags_elem] if tags_elem else []