Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- line1 = "**[Unclear](https://gfycat.com/BleakSomberKillifish)** [🔊](https://vlipsy.com/vlip/the-flash-unclear-4dElM7V5) [▶️](https://www.youtube.com/watch?v=3BjqvM3LSdQ)"
- line2 = "---"
- 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)"
- import praw
- SUBREDDIT_NAME = 'BrianiacFive+Constantine+VixenCWSeed+TheRayCWSeed+Arrow+FlashTV+LegendsOfTomorrow+SupergirlTV+CWArrow+DCTV'
- KEYWORDS = ['unclear']
- RESPONSE = line1 + '\n\n' + line2 + '\n\n' + line3
- USERNAME = 'BrianiacFive'
- PASSWORD = 'FUCKYOUBUDDY'
- CLIENT_ID = 'AYYLMAO'
- CLIENT_SECRET = 'DANKMEMES'
- USER_AGENT = 'script:reply to keywords in comments:v0.2:written by /u/doug89'
- print("Authenticating...")
- reddit = praw.Reddit(
- client_id=CLIENT_ID,
- client_secret=CLIENT_SECRET,
- password=PASSWORD,
- user_agent=USER_AGENT,
- username=USERNAME)
- print("Authenticaed as {}".format(reddit.user.me()))
- print('Starting comment stream...')
- for comment in reddit.subreddit(SUBREDDIT_NAME).stream.comments():
- if comment.saved:
- continue
- has_keyword = any(k.lower() in comment.body.lower() for k in KEYWORDS)
- not_self = comment.author != reddit.user.me()
- if has_keyword and not_self:
- comment.save()
- reply = comment.reply(RESPONSE)
- print('###Response Sent')
Add Comment
Please, Sign In to add comment