|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
from numpy import Infinity
|
|
|
|
|
from rich.console import Console
|
|
|
|
|
from utils.console import print_step, print_substep
|
|
|
|
|
from utils.console import print_step, print_substep, print_markdown
|
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
|
import os
|
|
|
|
|
import random
|
|
|
|
@ -74,14 +74,18 @@ def get_subreddit_threads():
|
|
|
|
|
content["comments"] = []
|
|
|
|
|
|
|
|
|
|
for top_level_comment in submission.comments:
|
|
|
|
|
if not top_level_comment.stickied:
|
|
|
|
|
content["comments"].append(
|
|
|
|
|
{
|
|
|
|
|
"comment_body": top_level_comment.body,
|
|
|
|
|
"comment_url": top_level_comment.permalink,
|
|
|
|
|
"comment_id": top_level_comment.id,
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
COMMENT_LENGTH_RANGE = [0, Infinity]
|
|
|
|
|
if os.getenv("COMMENT_LENGTH_RANGE"):
|
|
|
|
|
COMMENT_LENGTH_RANGE = [int(i) for i in os.getenv("COMMENT_LENGTH_RANGE").split(",")]
|
|
|
|
|
if COMMENT_LENGTH_RANGE[0] <= len(top_level_comment.body) <= COMMENT_LENGTH_RANGE[1]:
|
|
|
|
|
if not top_level_comment.stickied:
|
|
|
|
|
content["comments"].append(
|
|
|
|
|
{
|
|
|
|
|
"comment_body": top_level_comment.body,
|
|
|
|
|
"comment_url": top_level_comment.permalink,
|
|
|
|
|
"comment_id": top_level_comment.id,
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
except AttributeError:
|
|
|
|
|
pass
|
|
|
|
|