Created
December 26, 2020 18:50
-
-
Save readytheory/7b8f22db69c9eca7eb6d55bd32cf0d69 to your computer and use it in GitHub Desktop.
list reddit subs you've posted to
This file contains hidden or 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
import praw | |
import configparser | |
config = configparser.ConfigParser() | |
config.read("/secrets/earth-secrets.dev") | |
configs = config['ebooks'] | |
username = configs['username'] | |
password = configs['password'] | |
client_id = configs['client_id'] | |
client_secret = configs['client_secret'] | |
user_agent = configs['user_agent'] | |
reddit = praw.Reddit( | |
client_id=client_id, | |
client_secret=client_secret, | |
user_agent = user_agent, | |
username = username, | |
password = password | |
) | |
kstats = {} | |
x = reddit.user.karma() | |
for sub in x: | |
print(sub) | |
print(x[sub]["comment_karma"], x[sub]["link_karma"]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The file /secrets/earth-secrets.dev is an .ini type file used with configparser