Advertisement
Guest User

Untitled

a guest
Jan 26th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. """MADE BY u/KainoaTheMeme
  2.  
  3.  
  4. USE ONLY WITH CREDIT
  5.  
  6.  
  7. COMMENTED STUFF IS TOO GLITCHY TO WORK AS OF NOW
  8.  
  9.  
  10. """
  11. from urllib.parse import quote_plus
  12. import time
  13. import praw
  14. import sys
  15.  
  16. QUESTIONS=[]
  17. REPLY_TEMPLATE = 'Sub to r/sendhertotheranch'
  18. total=0
  19.  
  20. def main():
  21. reddit = praw.Reddit(user_agent='replybot',
  22. client_id='32IoU1BMWZ2R6g', client_secret='uaZThhB17zZiRvUWZmDh3-sxWHE',
  23. username='KainoaTheMeme', password='Kainoa14')
  24.  
  25. subreddit = reddit.subreddit('PewdiepieSubmissions')
  26. for submission in subreddit.stream.submissions():
  27. process_submission(submission)
  28.  
  29.  
  30.  
  31. def process_submission(submission):
  32. ## normalized_title = submission.title.lower()
  33. ## if 'ranch' in normalized_title:
  34. try:
  35. url_title = quote_plus(submission.title)
  36. reply_text = REPLY_TEMPLATE.format(url_title)
  37. print('Replying to: {}'.format(submission.title))
  38. submission.reply(reply_text)
  39. time.sleep(15)
  40. ## total+=1
  41. main()
  42. except:
  43. print("(=w=)")
  44. main()
  45. ## except KeyboardInterrupt:
  46. ## try:
  47. ## sure=input("1 for just checking, 2 for kill")
  48. ## if sure==2:
  49. ## print("Number of sucsessful comments:",total)
  50. ## sys.exit(0)
  51. ## if sure==1:
  52. ## print("Number of sucsessful comments so far:",total)
  53. ## main()
  54. ## except:
  55. ## main()
  56.  
  57.  
  58.  
  59. if __name__ == '__main__':
  60. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement