Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Reddit auto responder
- # Imports
- import praw
- import time
- #initialise reddit comment scraper
- bot = praw.Reddit(user_agent='I_hate_Moster_Math autoresponder v1.1.3',
- client_id='*****',
- client_secret='******',
- username='Im_Fucking_Saying_It',
- password='*******')
- subreddit = bot.subreddit('all')
- comments = subreddit.stream.comments()
- foundTimes=0
- timesChecked=0
- #run loop
- while True:
- for comment in comments:
- timesChecked = timesChecked+1
- text = comment.body
- author = comment.author
- subreddit = comment.subreddit
- print('')
- print('times checked for comment: '+str(timesChecked))
- print('Times found so far ' +str(foundTimes))
- #Reactions
- #1st reply
- if 'r/dontfuckingsayit' in text.lower() and 'I_Hate_Monster_Math' == author:
- print('found ' + str(author) + ' in ' + str(subreddit))
- foundTimes=foundTimes+1
- print(str(text))
- replied = False
- while replied == False:
- try:
- comment.reply('r/theydidthemonstermath')
- replied = True
- except:
- print('Posted too much sleeping for 1 minute')
- time.sleep(60)
- continue
- #2nd reply
- elif 'stutter' in text.lower() and 'I_Hate_Monster_Math' == author:
- print('found ' + str(author) + ' in ' + str(subreddit))
- foundTimes=foundTimes+1
- print(str(text))
- replied = False
- while replied == False:
- try:
- comment.reply('r/itwasagraveyardgraph')
- replied = True
- except:
- print('Posted too much sleeping for 1 minute')
- time.sleep(60)
- continue
- #3rd reply
- elif 'graveyard' in text.lower() and 'I_Hate_Monster_Math' == author:
- print('found ' + str(author) + ' in ' + str(subreddit))
- foundTimes=foundTimes+1
- print(str(text))
- replied = False
- while replied == False:
- try:
- comment.reply('r/shitredditsays')
- replied = True
- except:
- print('Posted too much sleeping for 1 minute')
- time.sleep(60)
- continue
- #karma whoring
- elif 'im_fucking_saying_it' in text.lower() and "LikeAshitBrickHouse" == author:
- replied=False
- while replied == False:
- try:
- print('You posted')
- comment.reply('Can confirm, This guy owns me')
- time.sleep(2)
- replied = True
- except:
- print('posted too much sleeping for 1 minute')
- continue
- #testing
- elif 'test' in text.lower() and "LikeAshitBrickHouse" == author:
- replied=False
- while replied == False:
- try:
- print('You posted')
- comment.reply('testing complete')
- time.sleep(2)
- replied = True
- except:
- print('posted too much sleeping for 1 minute')
- continue
Add Comment
Please, Sign In to add comment