Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import config
- import time
- import os
- import requests
- import random
- print("not deporting the flares")
- def login():
- print("haxing the webs")
- r = praw.Reddit(username = config.username,
- password = config.password,
- client_id = config.client_id,
- client_secret = config.client_secret,
- user_agent = 'Upvote and fighter bot for r/kickdownthedoor.',
- )
- print("logged on")
- return r
- def run(r, saved_list, some_list):
- for comment in r.subreddit('kickitopentest').comments(limit=20):
- if "gimme class" in comment.body and comment.id not in replied_list and comment.author != r.user.me():
- print("making sure this isn't deja vu...")
- print("giving flairs")
- r.subreddit('kickitopentest').flair.set('VirtuousVermin', some_list[placeholder])
- print("flairs gimmied")
- comment.reply("class gimmied")
- print("replied, id is" + comment.id)
- replied_list.append(comment.id)
- with open ("list.txt", "a") as f:
- f.write(comment.id + "\n")
- print("do not call list updated")
- print("not getting ratelimited...")
- time.sleep(10)
- def saved_list():
- with open("list.txt", "r") as f:
- replied_list = f.read()
- replied_list = replied_list.split()
- return replied_list
- some_list = ['Halfling', 'Dwarf', 'Elf', 'Orc']
- placeholder = random.randint(0,3)
- r = login()
- replied_list = saved_list()
- while True:
- run(r, saved_list, some_list)
- subreddit = r.subreddit('kickitopentest')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement