Advertisement
Guest User

code

a guest
Jan 3rd, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1.     --6Ep96ck9@protonmail.com-- '''
  2.  
  3. # Import required libraries
  4.  
  5. import praw
  6. import pdb
  7. import re
  8. import os
  9. import time
  10. import random
  11. import sys
  12. from datetime import datetime
  13.  
  14. # Create a Reddit API instance
  15.  
  16. reddit = praw.Reddit(user_agent='<useragent>',
  17.           client_id='<clientid>',
  18.               client_secret='<clientsecret>',
  19.           username='<username>',
  20.           password='<password>')
  21.  
  22. # Set up subreddit parameters
  23.  
  24. subreddit = reddit.subreddit("<subreddit")
  25.  
  26. # Set up quotes library
  27.  
  28. quotes = \
  29. [
  30. " <quotation.> ",
  31. " <quotation.> ",
  32. " <quotation.> ",
  33.  
  34. ]
  35.  
  36. # Set up comment parameters
  37.  
  38. for comment in subreddit.stream.comments():
  39.    if re.search("<string you want to locate>",     comment.body, re.IGNORECASE):
  40.        reply = random.choice(quotes)
  41.        comment.reply(reply)
  42.  
  43. # Cooldown
  44.  
  45. time.sleep(n) # in seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement