Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import datetime
- import time
- u = '' #username
- p = '' #password
- c_id = '' #client_id
- c_s = '' #client secret
- subreddit = '' #put in subreddit name
- reddit = praw.Reddit(username = u, password = p, client_id = c_id, client_secret = c_s, user_agent = 'Karma/Hour Remover v 1.0')
- def remove(submission):
- if (datetime.datetime.now() - datetime.datetime.fromtimestamp(submission.created)).seconds >= 3600 and submission.score < 10:
- comment = submission.reply('You submission has been removed because it had less than 10 karma in 1 hour.')
- comment.distinguish(how=βyesβ, sticky=True)
- submission.mod.remove()
- def main(reddit):
- while True:
- for sub in reddit.subreddit(str(subreddit)).new():
- remove(sub)
- time.sleep(60) #waits a minute before re-sifting through posts
- if __name__ == '__main__':
- main(reddit)
Add Comment
Please, Sign In to add comment