Skip to content

Instantly share code, notes, and snippets.

@kusti8
Created July 1, 2016 20:32
Show Gist options
  • Save kusti8/9f23b682a2bfb641c7c16b7ccb91141d to your computer and use it in GitHub Desktop.
Save kusti8/9f23b682a2bfb641c7c16b7ccb91141d to your computer and use it in GitHub Desktop.
import praw
r = praw.Reddit("Most downvoted comment by /u/kusti8")
r.login('####', "####", disable_warning=True)
already_done = []
def most_downvoted(user_name):
user = r.get_redditor(user_name)
gen = user.get_comments(limit=None)
score = 99999999999999
title = ''
for possible in gen:
if possible.score < score:
score = possible.score
title = possible.body
return title, score
while True:
submission = r.get_submission(submission_id='4qtry6')
submission.replace_more_comments(limit=None, threshold=0)
comments = submission.comments
for comment in comments:
if comment.id not in already_done:
body, score = most_downvoted(comment.author)
comment.reply("Your most downvoted: " + body + "**It got a score of " + str(score) + "** \n\n&nbsp;\n\nI am a bot")
already_done.append(comment.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment