Create a gist now

Instantly share code, notes, and snippets.

ShockedRarity bot
import praw
import time
manspike = '(/manspike)'
rarishock = '[](/rarishock)'
reddit = praw.Reddit('Responds to (/manspike) on /r/mylittlepony with (/rarishock) '
'by /u/jmgrosen/')
reddit.login('ShockedRarity', '********')
already_done = []
while True:
rmlp = reddit.get_subreddit('mylittlepony')
for comment in rmlp.get_comments():
if comment.id not in already_done and manspike in comment.body:
print comment.id, comment.body
comment.reply(' '.join([rarishock for _ in range(comment.body.count(manspike))]))
already_done.append(comment.id)
time.sleep(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment