Added max comment length variable in env

pull/334/head
Riccardo Benedetti 3 years ago
parent cf6b3a9c44
commit b03089def0

@ -16,5 +16,8 @@ THEME=""
# Enter a subreddit, e.g. "AskReddit" # Enter a subreddit, e.g. "AskReddit"
SUBREDDIT="" SUBREDDIT=""
# Max reddit comments length in characters e.g. "100"
MAX_COMMENT_LEN="100"
# Range is 0 -> 1 # Range is 0 -> 1
OPACITY="0.9" OPACITY="0.9"

@ -1,3 +1,4 @@
from email.mime import base
from rich.console import Console from rich.console import Console
from utils.console import print_markdown, print_step, print_substep from utils.console import print_markdown, print_step, print_substep
from dotenv import load_dotenv from dotenv import load_dotenv
@ -67,6 +68,7 @@ def get_subreddit_threads():
for top_level_comment in submission.comments: for top_level_comment in submission.comments:
if not top_level_comment.stickied: if not top_level_comment.stickied:
if len(top_level_comment.body) <= int(os.getenv("MAX_COMMENT_LEN")):
content["comments"].append( content["comments"].append(
{ {
"comment_body": top_level_comment.body, "comment_body": top_level_comment.body,

Loading…
Cancel
Save