|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
from numpy import Infinity
|
|
|
|
from utils.console import print_markdown, print_step, print_substep
|
|
|
|
from utils.console import print_markdown, print_step, print_substep
|
|
|
|
import praw
|
|
|
|
import praw
|
|
|
|
import random
|
|
|
|
import random
|
|
|
@ -58,13 +59,17 @@ def get_subreddit_threads():
|
|
|
|
content["comments"] = []
|
|
|
|
content["comments"] = []
|
|
|
|
|
|
|
|
|
|
|
|
for top_level_comment in submission.comments:
|
|
|
|
for top_level_comment in submission.comments:
|
|
|
|
content["comments"].append(
|
|
|
|
COMMENT_LENGHT_RANGE = [0, Infinity]
|
|
|
|
{
|
|
|
|
if os.getenv("COMMENT_LENGHT_RANGE"):
|
|
|
|
"comment_body": top_level_comment.body,
|
|
|
|
COMMENT_LENGHT_RANGE = [int(i) for i in os.getenv("COMMENT_LENGHT_RANGE").split(",")]
|
|
|
|
"comment_url": top_level_comment.permalink,
|
|
|
|
if COMMENT_LENGHT_RANGE[0] <= len(top_level_comment.body) <= COMMENT_LENGHT_RANGE[1]:
|
|
|
|
"comment_id": top_level_comment.id,
|
|
|
|
content["comments"].append(
|
|
|
|
}
|
|
|
|
{
|
|
|
|
)
|
|
|
|
"comment_body": top_level_comment.body,
|
|
|
|
|
|
|
|
"comment_url": top_level_comment.permalink,
|
|
|
|
|
|
|
|
"comment_id": top_level_comment.id,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
except AttributeError as e:
|
|
|
|
except AttributeError as e:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|