Guest User

Untitled

a guest
Dec 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import praw
  2. import datetime
  3. import time
  4.  
  5.  
  6. u = '' #username
  7. p = '' #password
  8. c_id = '' #client_id
  9. c_s = '' #client secret
  10.  
  11. subreddit = '' #put in subreddit name
  12.  
  13. reddit = praw.Reddit(username = u, password = p, client_id = c_id, client_secret = c_s, user_agent = 'Karma/Hour Remover v 1.0')
  14.  
  15.  
  16. def remove(submission):
  17. if (datetime.datetime.now() - datetime.datetime.fromtimestamp(submission.created)).seconds >= 3600 and submission.score < 10:
  18. comment = submission.reply('You submission has been removed because it had less than 10 karma in 1 hour.')
  19. comment.distinguish(how=’yes’, sticky=True)
  20. submission.mod.remove()
  21.  
  22.  
  23. def main(reddit):
  24. while True:
  25. for sub in reddit.subreddit(str(subreddit)).new():
  26. remove(sub)
  27. time.sleep(60) #waits a minute before re-sifting through posts
  28.  
  29.  
  30. if __name__ == '__main__':
  31. main(reddit)
Add Comment
Please, Sign In to add comment