Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import praw
  2.  
  3. r = praw.Reddit('Homophone Triplet Game by /u/NotFlameRetardant')
  4. r.login('HomophoneTripletBot', PASSWORD, disable_warning=True)
  5. submission = r.get_submission(submission_id='3j1lso')
  6. flat_comments = praw.helpers.flatten_tree(submission.comments)
  7. already_done = set()
  8. count = 0
  9. wordset = [['there', 'their', 'they\'re'], ['two', 'too', 'to'], ['buy', 'by', 'bye'], ['write', 'right', 'rite']]
  10.  
  11. for comment in flat_comments:
  12. if not comment.author:
  13. continue
  14. if comment.id not in already_done:
  15. for subset in wordset:
  16. if all(hphones in subset for hphones in comment.body):
  17. count += 1
  18. if (count > 0):
  19. comment.reply('**' + str(count) + '**\n\nid:' + str(comment.id))
  20. # already_done.add(comment.id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement