Advertisement
Guest User

Untitled

a guest
Feb 1st, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. LOOP = False # This determines whether or not the program will stop after one execution
  2. TARGET = 'PERSON TO TARGET' # Make sure in quotations, this is the person who will be affected
  3. UPVOTE = True #If this is False, the program will downvote instead
  4. COM_NUM = 1 #The number of recent comments to upvote or downvote
  5.  
  6. account1 = ['YourUsernameHere', 'YourPasswordHere']
  7. account2 = ['YourSecondUsernameHere', 'YourSecondPasswordHere']
  8. #This one is optianal. You can add as many other accounts as you wish, as long as you add them to aList
  9.  
  10. aList = [account1, account2] #Keep these the same, just add more if needed
  11.  
  12. #The Source Code will be down here. Nothing below this point needs to be edited in order for it to work. Just fill in the information above and the script will function#
  13.  
  14. import praw
  15. import time
  16.  
  17. start = time.time()
  18. r = praw.Reddit(user_agent='Upvote Script')
  19.  
  20. def runBot(account):
  21. username = account[0]
  22. password = account[1]
  23. r.login(username, password, disable_warning=True)
  24. user = r.get_redditor(TARGET)
  25. comments = user.get_comments(limit=COM_NUM)
  26. if UPVOTE:
  27. for comment in comments:
  28. comment.upvote()
  29. if not UPVOTE:
  30. for comment in comments:
  31. comment.downvote()
  32.  
  33. def main():
  34. for account in aList:
  35. runBot(account)
  36. end = time.time()
  37. elapsed = end - start
  38. print('Done with ' + str(account[0]) + ' in ' + str(elapsed) + ' seconds')
  39. end = time.time()
  40. elapsed = end - start
  41. print('Finished in ' + str(elapsed) + ' seconds')
  42.  
  43. while True:
  44. main()
  45. if not LOOP:
  46. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement