Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import config
- import time
- def bot_login():
- print "Loggin in..."
- r = praw.Reddit(username = config.username,
- password = config.password,
- client_id = config.client_id,
- client_secret = config.client_secret,
- user_agent = “abe’s mushroom spambot”)
- print "Logged in!"
- return r
- def run_bot(r):
- print "Obtaining 25 comments..."
- for comment in r.all(‘test').comments(limit=25):
- if “mushroom” in comment.body:
- print "String with \”mushroom\” found in comment " + comment.id
- comment.reply(“>mushroom Fuck Mushrooms /r/mushroomhate“)
- print "Replied to comment " + comment.id
- print "Sleeping for 10 seconds..."
- #Sleep for 10 seconds...
- time.sleep(10)
- r = bot_login()
- while True:
- run_bot(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement