Skip to content

Instantly share code, notes, and snippets.

@readytheory
Created December 26, 2020 18:50
Show Gist options
  • Save readytheory/7b8f22db69c9eca7eb6d55bd32cf0d69 to your computer and use it in GitHub Desktop.
Save readytheory/7b8f22db69c9eca7eb6d55bd32cf0d69 to your computer and use it in GitHub Desktop.
list reddit subs you've posted to
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"])
@readytheory
Copy link
Author

The file /secrets/earth-secrets.dev is an .ini type file used with configparser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment