Guest User

Untitled

a guest
Feb 6th, 2018
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. #Reddit auto responder
  2.  
  3. # Imports
  4. import praw
  5. import time
  6.  
  7. #initialise reddit comment scraper
  8.  
  9. bot = praw.Reddit(user_agent='I_hate_Moster_Math autoresponder v1.1.3',
  10. client_id='*****',
  11. client_secret='******',
  12. username='Im_Fucking_Saying_It',
  13. password='*******')
  14. subreddit = bot.subreddit('all')
  15. comments = subreddit.stream.comments()
  16. foundTimes=0
  17. timesChecked=0
  18.  
  19. #run loop
  20. while True:
  21.  
  22. for comment in comments:
  23. timesChecked = timesChecked+1
  24. text = comment.body
  25. author = comment.author
  26. subreddit = comment.subreddit
  27. print('')
  28. print('times checked for comment: '+str(timesChecked))
  29. print('Times found so far ' +str(foundTimes))
  30.  
  31. #Reactions
  32.  
  33. #1st reply
  34. if 'r/dontfuckingsayit' in text.lower() and 'I_Hate_Monster_Math' == author:
  35. print('found ' + str(author) + ' in ' + str(subreddit))
  36. foundTimes=foundTimes+1
  37. print(str(text))
  38. replied = False
  39. while replied == False:
  40. try:
  41. comment.reply('r/theydidthemonstermath')
  42. replied = True
  43. except:
  44. print('Posted too much sleeping for 1 minute')
  45. time.sleep(60)
  46. continue
  47. #2nd reply
  48. elif 'stutter' in text.lower() and 'I_Hate_Monster_Math' == author:
  49. print('found ' + str(author) + ' in ' + str(subreddit))
  50. foundTimes=foundTimes+1
  51. print(str(text))
  52. replied = False
  53. while replied == False:
  54. try:
  55. comment.reply('r/itwasagraveyardgraph')
  56. replied = True
  57. except:
  58. print('Posted too much sleeping for 1 minute')
  59. time.sleep(60)
  60. continue
  61. #3rd reply
  62. elif 'graveyard' in text.lower() and 'I_Hate_Monster_Math' == author:
  63. print('found ' + str(author) + ' in ' + str(subreddit))
  64. foundTimes=foundTimes+1
  65. print(str(text))
  66. replied = False
  67. while replied == False:
  68. try:
  69. comment.reply('r/shitredditsays')
  70. replied = True
  71. except:
  72. print('Posted too much sleeping for 1 minute')
  73. time.sleep(60)
  74. continue
  75.  
  76.  
  77. #karma whoring
  78. elif 'im_fucking_saying_it' in text.lower() and "LikeAshitBrickHouse" == author:
  79. replied=False
  80. while replied == False:
  81. try:
  82. print('You posted')
  83. comment.reply('Can confirm, This guy owns me')
  84. time.sleep(2)
  85. replied = True
  86. except:
  87. print('posted too much sleeping for 1 minute')
  88. continue
  89.  
  90. #testing
  91. elif 'test' in text.lower() and "LikeAshitBrickHouse" == author:
  92. replied=False
  93. while replied == False:
  94. try:
  95. print('You posted')
  96. comment.reply('testing complete')
  97. time.sleep(2)
  98. replied = True
  99. except:
  100. print('posted too much sleeping for 1 minute')
  101. continue
Add Comment
Please, Sign In to add comment