Advertisement
Guest User

Untitled

a guest
Sep 9th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. import praw
  2. import config
  3. import time
  4. import os
  5. import requests
  6. import random
  7. print("not deporting the flares")
  8.  
  9.  
  10. def login():
  11. print("haxing the webs")
  12. r = praw.Reddit(username = config.username,
  13. password = config.password,
  14. client_id = config.client_id,
  15. client_secret = config.client_secret,
  16. user_agent = 'Upvote and fighter bot for r/kickdownthedoor.',
  17. )
  18. print("logged on")
  19. return r
  20.  
  21. def run(r, saved_list, some_list):
  22. for comment in r.subreddit('kickitopentest').comments(limit=20):
  23. if "gimme class" in comment.body and comment.id not in replied_list and comment.author != r.user.me():
  24. print("making sure this isn't deja vu...")
  25. print("giving flairs")
  26. r.subreddit('kickitopentest').flair.set('VirtuousVermin', some_list[placeholder])
  27. print("flairs gimmied")
  28. comment.reply("class gimmied")
  29. print("replied, id is" + comment.id)
  30.  
  31. replied_list.append(comment.id)
  32.  
  33.  
  34. with open ("list.txt", "a") as f:
  35. f.write(comment.id + "\n")
  36. print("do not call list updated")
  37.  
  38.  
  39. print("not getting ratelimited...")
  40. time.sleep(10)
  41.  
  42. def saved_list():
  43. with open("list.txt", "r") as f:
  44. replied_list = f.read()
  45. replied_list = replied_list.split()
  46. return replied_list
  47.  
  48.  
  49. some_list = ['Halfling', 'Dwarf', 'Elf', 'Orc']
  50.  
  51. placeholder = random.randint(0,3)
  52.  
  53. r = login()
  54. replied_list = saved_list()
  55. while True:
  56. run(r, saved_list, some_list)
  57.  
  58. subreddit = r.subreddit('kickitopentest')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement