Created
February 7, 2020 04:04
-
-
Save dev4Fun/469fcea5cc5263a04150edf58bb58283 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main.py | |
import json | |
import logging | |
import os | |
from pathlib import Path | |
from bot import RedditBot | |
logging.basicConfig(handlers=[logging.StreamHandler()], | |
level=logging.INFO, | |
format='%(asctime)s %(threadName)-12s %(levelname).4s %(message)s', | |
datefmt='%a %d %H:%M:%S') | |
current_dir = Path(os.path.dirname(os.path.abspath(__file__))) | |
def read_all_credentials(): | |
with open(current_dir.joinpath("client_creds.json")) as cred_f: | |
return json.load(cred_f) | |
if __name__ == '__main__': | |
credentials = read_all_credentials() | |
bot = RedditBot(credentials[0]) | |
bot.work_on_subreddit('FreeKarma4U', limit=5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment