Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. # http://praw.readthedocs.io/en/latest/getting_started/authentication.html
  2. reddit = praw.Reddit(client_id='your app client id',
  3. client_secret='your app client secret',
  4. username='your bot reddit username',
  5. password='your bot reddit password',
  6. user_agent='python3:KeyWordNotify:v1 (/u/Arkaon)')
  7.  
  8.  
  9. you = reddit.redditor('your reddit username') # this is the account that will receive the messages
  10. subreddit = reddit.subreddit('your subreddit name') # scan comments in this subreddit
  11.  
  12. keywords = ['keyword1', 'keyword2', 'keyword3'] # case insensitive
  13. ignore_users = ['baduser1', 'baduser2', 'baduser3'] # case SENSITIVE
  14.  
  15. already_alerted_submissions = [] # a list of submission ids that you have already been notified for
  16.  
  17. comment_stream = subreddit.stream.comments()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement