remove emojies from posting reddit and others
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user