Guest User

Untitled

a guest
Dec 20th, 2018
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. import praw
  2.  
  3. SUB = "somesub" # subreddit to watch for comments
  4. TO_SKIP = ['HappySilveon', 'AutoModerator'] # list of users to ignore
  5. SUBJECT = "Some subject" # required subject for the PM
  6. REPLY = "PM content here." # The content of the PM we'll respond with
  7.  
  8.  
  9. def main():
  10. reddit = praw.Reddit(user_agent='/u/HappySilveon reply script',
  11. client_id='CLIENT_ID', client_secret='CLIENT_SECRET',
  12. username='USERNAME', password='PASSWORD')
  13. sub = reddit.subreddit(SUB)
  14. for cmt in sub.stream.comments(skip_existing=True):
  15. user = str(cmt.author)
  16. if user not in TO_SKIP:
  17. reddit.redditor(user).message(SUBJECT, REPLY)
  18.  
  19.  
  20. if __name__ == '__main__':
  21. main()
Add Comment
Please, Sign In to add comment