remove " from cta

my-fix-branch
Shane 7 months ago
parent 2d86085867
commit c1b37ff579
  1. 9
      foodie_hooks.py

@ -28,7 +28,7 @@ def get_dynamic_hook(article_title):
except Exception as e:
logging.error(f"Dynamic hook generation failed: {e}")
return "This food scoop will blow your mind!"
def get_viral_share_prompt(article_title, content):
try:
prompt = (
@ -36,6 +36,7 @@ def get_viral_share_prompt(article_title, content):
"Make it bold, quirky, and engaging with a Buzzfeed/Upworthy flair (e.g., 'Obsessed? Share Now'). "
"Avoid clichés like 'game-changer' and words like 'elevate'. "
"Do not include emojis, the platform name (e.g., Twitter, Facebook), or any HTML. "
"Do not wrap the prompt in quotation marks. "
"Return only the prompt text."
)
response = client.chat.completions.create(
@ -45,9 +46,11 @@ def get_viral_share_prompt(article_title, content):
{"role": "user", "content": f"Title: {article_title}\nContent: {content}"}
],
max_tokens=20,
temperature=0.9 # Higher temperature for more creativity
temperature=0.9
)
share_prompt = response.choices[0].message.content.strip()
# Remove any leading or trailing quotation marks
share_prompt = share_prompt.strip('"\'')
logging.info(f"Generated viral share prompt: {share_prompt}")
return share_prompt
except Exception as e:
@ -56,10 +59,8 @@ def get_viral_share_prompt(article_title, content):
def select_best_cta(title, content, post_url=None):
cta_templates = [
# Like-focused CTAs
"Love This Foodie Find Hit That Like Button",
"Think This Dish Is a Game Changer Show Some Love With a Like",
# Follow-focused CTAs
"Hungry for More Foodie Insights Follow Us for the Latest Trends",
"Dont Miss Out on Foodie Updates Follow Us Today"
]

Loading…
Cancel
Save