Guest User

Untitled

a guest
Feb 12th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. line1 = "**[Unclear](https://gfycat.com/BleakSomberKillifish)** [🔊](https://vlipsy.com/vlip/the-flash-unclear-4dElM7V5) [▶️](https://www.youtube.com/watch?v=3BjqvM3LSdQ)"
  2. line2 = "---"
  3. line3 = "[Suggestions](https://redd.it/7wwd82) | [Contact](https://www.reddit.com/message/compose/?to=ShaneH7646&subject=BrianiacFive) | [Latest Updates](https://www.reddit.com/r/BrianiacFive)"
  4.  
  5. import praw
  6.  
  7. SUBREDDIT_NAME = 'BrianiacFive+Constantine+VixenCWSeed+TheRayCWSeed+Arrow+FlashTV+LegendsOfTomorrow+SupergirlTV+CWArrow+DCTV'
  8. KEYWORDS = ['unclear']
  9. RESPONSE = line1 + '\n\n' + line2 + '\n\n' + line3
  10.  
  11. USERNAME = 'BrianiacFive'
  12. PASSWORD = 'FUCKYOUBUDDY'
  13. CLIENT_ID = 'AYYLMAO'
  14. CLIENT_SECRET = 'DANKMEMES'
  15.  
  16. USER_AGENT = 'script:reply to keywords in comments:v0.2:written by /u/doug89'
  17.  
  18. print("Authenticating...")
  19. reddit = praw.Reddit(
  20. client_id=CLIENT_ID,
  21. client_secret=CLIENT_SECRET,
  22. password=PASSWORD,
  23. user_agent=USER_AGENT,
  24. username=USERNAME)
  25. print("Authenticaed as {}".format(reddit.user.me()))
  26.  
  27. print('Starting comment stream...')
  28. for comment in reddit.subreddit(SUBREDDIT_NAME).stream.comments():
  29. if comment.saved:
  30. continue
  31. has_keyword = any(k.lower() in comment.body.lower() for k in KEYWORDS)
  32. not_self = comment.author != reddit.user.me()
  33. if has_keyword and not_self:
  34. comment.save()
  35. reply = comment.reply(RESPONSE)
  36. print('###Response Sent')
Add Comment
Please, Sign In to add comment