Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. '''
  2. Created on Sep 18, 2017
  3.  
  4. @author: Seth
  5. '''
  6. import praw
  7. import collections
  8. from praw.models import MoreComments
  9. import time
  10.  
  11.  
  12.  
  13. reddit = praw.Reddit(client_id='wJ8TIOqn_jW3lQ',
  14. client_secret='0uXoA4p-KU0DvyUW8rau6L-Po28',
  15. user_agent='Python fake finder v1.0 (by /u/imalittletestbot)',
  16. username='imalittletestbot',
  17. password='stoutandshort')
  18.  
  19.  
  20. '''submission = next(reddit.subreddit('Politics').hot(limit=4))'''
  21. for submission in reddit.subreddit('Politics').new(limit=4):
  22. time.sleep(3)
  23. '''submission.comments.replace_more(limit=None, threshold=2)'''
  24. while True:
  25. try:
  26. submission.comments.replace_more()
  27. break
  28. except PossibleExceptions:
  29. print('Handling replace_more exception')
  30. sleep(1)
  31. comments = submission.comments.list()
  32. print(submission.title)
  33. for comment in comments:
  34. if comment.author is not None:
  35. print(comment.author.name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement