Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import praw
- import configparser
- config = configparser.ConfigParser()
- config.read('reddit_inbox.ini')
- '''
- This script gets the login info from the ini-file and will test it against
- reddit's oauth login. If this works you will receive an output with your
- username and how much karma you have.
- '''
- r = praw.Reddit(client_id=config['reddit']['client_id'],
- client_secret=config['reddit']['client_secret'],
- user_agent=config['reddit']['useragent'],
- password=config['reddit']['password'],
- username=config['reddit']['username']
- )
- authenticated_user = r.user.me()
- print(authenticated_user.name, authenticated_user.link_karma)
Add Comment
Please, Sign In to add comment