Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import praw
  2. import os
  3. import time
  4. import datetime
  5. from multiprocessing import Process
  6.  
  7. USERNAME = [redacted]
  8. PASSWORD = [redacted]
  9. CLIENT_ID = [redacted]
  10. CLIENT_SECRET = [redacted]
  11.  
  12. USER_AGENT = 'script:edit sidebar for /r/solidshibe:by /u/ioi_xd'
  13.  
  14. print("Authenticating...")
  15. reddit = praw.Reddit(
  16. client_id=CLIENT_ID,
  17. client_secret=CLIENT_SECRET,
  18. password=PASSWORD,
  19. user_agent=USER_AGENT,
  20. username=USERNAME)
  21. print("Authenticaed as {}".format(reddit.user.me()))
  22.  
  23. def sidebar(sub,n,time):
  24. sub = reddit.subreddit(sub)
  25. mod = sub.mod
  26. settings = mod.settings()
  27. sidebar_contents = settings['description']
  28. L = sidebar_contents.split('\n')
  29. num = int(L[n]) + 1
  30. L[n] = str(num)
  31. sub.mod.update(description='\n'.join(L))
  32. sleep(time)
  33.  
  34. x = 1
  35. while True:
  36. sidebar(SolidShibe,n,86400)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement