Last active
December 20, 2018 20:05
-
-
Save gavin19/dd6325bc4a074a6d40c44992b0082ff5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw | |
SUB = "somesub" # subreddit to watch for comments | |
TO_SKIP = ['HappySilveon', 'AutoModerator'] # list of users to ignore | |
SUBJECT = "Some subject" # required subject for the PM | |
REPLY = "PM content here." # The content of the PM we'll respond with | |
def main(): | |
reddit = praw.Reddit(user_agent='/u/HappySilveon reply script', | |
client_id='CLIENT_ID', client_secret='CLIENT_SECRET', | |
username='USERNAME', password='PASSWORD') | |
sub = reddit.subreddit(SUB) | |
for cmt in sub.stream.comments(skip_existing=True): | |
user = str(cmt.author) | |
if user not in TO_SKIP: | |
reddit.redditor(user).message(SUBJECT, REPLY) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment