SHARE
TWEET

Untitled

a guest Apr 26th, 2018 88 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. password = getpass.getpass("Password for %s: " % login)
  12.  
  13. print "Setting up"
  14. r = reddit.Reddit(user_agent="InfiniteMods Python Script")
  15. print "Logging in"
  16. r.login(user=login, password=password)
  17.  
  18. print "Looking up /r/%s" % subreddit
  19. sub = r.get_subreddit(subreddit)
  20. #print dir(sub)
  21.  
  22. print "Looking up user %s" % username
  23. user = r.get_redditor(username)
  24.  
  25. print "Adding %s as a mod to /r/%s" % (user, subreddit)
  26. ret = sub.make_moderator(user)
  27. print ret
  28.  
  29. # This doesn't work because there are too many mods in InfiniteMods
  30. #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