Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import re
- # User will need at least 2 karma to bypass captcha
- uname = "" # EDIT WITH USERNAME
- upass = "" #EDIT WITH PASSWORD
- cache = []
- r = praw.Reddit(user_agent = "null")
- r.login(uname, upass, disable_warning = True)
- print("[LOG] Logged in.")
- subreddit = r.get_subreddit("all")
- clearcache = 0
- while True:
- clearcache += 1
- try:
- for submission in subreddit.get_new(limit = 10):
- print(submission.title)
- title = submission.title.lower()
- if submission.id not in cache and re.search(r"don'?t ?upvote", title):
- submission.downvote() # lol
- print("[LOG] Post downvoted :( ")
- cache.append(submission.id)
- except: # Assuming reddit goes down
- time.sleep(100)
- continue
- time.sleep(60)
- if clearcache > 100: # Hopefully will avoid cache becoming too full or bloated
- cache = []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement