SHARE
TWEET

Untitled

a guest Apr 26th, 2018 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2.  
  3. import sys
  4. import reddit
  5. import getpass
  6.  
  7. login = sys.argv[1]
  8. subreddit = sys.argv[2]
  9. username = sys.argv[3]
  10.  
  11. humancentipede = username.split('\n')
  12.  
  13. password = getpass.getpass("Password for %s: " % login)
  14.  
  15. print "Setting up"
  16. r = reddit.Reddit(user_agent="InfiniteMods Python Script")
  17. print "Logging in"
  18. r.login(user=login, password=password)
  19.  
  20. print "Looking up /r/%s" % subreddit
  21. sub = r.get_subreddit(subreddit)
  22. #print dir(sub)
  23.  
  24. for human in humancentipede:
  25.     print "Looking up user %s" % human
  26.     user = r.get_redditor(human)
  27.  
  28.     print "Adding %s as a mod to /r/%s" % (user, subreddit)
  29.     ret = sub.make_moderator(user)
  30.     print ret
  31.  
  32. # This doesn't work because there are too many mods in InfiniteMods
  33. #for mod in sub.get_moderators(): print mod
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top