Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- r = praw.Reddit('Homophone Triplet Game by /u/NotFlameRetardant')
- r.login('HomophoneTripletBot', PASSWORD, disable_warning=True)
- submission = r.get_submission(submission_id='3j1lso')
- flat_comments = praw.helpers.flatten_tree(submission.comments)
- already_done = set()
- count = 0
- wordset = [['there', 'their', 'they\'re'], ['two', 'too', 'to'], ['buy', 'by', 'bye'], ['write', 'right', 'rite']]
- for comment in flat_comments:
- if not comment.author:
- continue
- if comment.id not in already_done:
- for subset in wordset:
- if all(hphones in subset for hphones in comment.body):
- count += 1
- if (count > 0):
- comment.reply('**' + str(count) + '**\n\nid:' + str(comment.id))
- # already_done.add(comment.id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement