From eeeaff0a0497cbd1ec3ab4461667741ffb1fb791 Mon Sep 17 00:00:00 2001 From: null3000 <76852813+null3000@users.noreply.github.com> Date: Tue, 7 Jun 2022 01:50:30 +0200 Subject: [PATCH] gives user thread stats --- reddit/subreddit.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index c560293..d4c2cc9 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -57,7 +57,14 @@ def get_subreddit_threads(): threads = subreddit.hot(limit=25) submission = list(threads)[random.randrange(0, 25)] - print_substep(f"Video will be: {submission.title} :thumbsup:") + upvotes=submission.score + ratio=submission.upvote_ratio * 100 + num_comments=submission.num_comments + + console.log(f"[bold green] Video will be: {submission.title} :thumbsup:") + console.log(f"[bold blue] Thread has " + str(upvotes) + " upvotes") + console.log(f"[bold blue] Thread has a upvote ratio of " + str(ratio) + "%") + console.log(f"[bold blue] Thread has " + str(num_comments) + " comments") console.log("Getting video comments...") try: content["thread_url"] = submission.url