Guest User

Untitled

a guest
May 26th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. import praw
  3. import configparser
  4.  
  5. config = configparser.ConfigParser()
  6. config.read('reddit_inbox.ini')
  7.  
  8. '''
  9. This script gets the login info from the ini-file and will test it against
  10. reddit's oauth login. If this works you will receive an output with your
  11. username and how much karma you have.
  12. '''
  13.  
  14. r = praw.Reddit(client_id=config['reddit']['client_id'],
  15. client_secret=config['reddit']['client_secret'],
  16. user_agent=config['reddit']['useragent'],
  17. password=config['reddit']['password'],
  18. username=config['reddit']['username']
  19. )
  20.  
  21. authenticated_user = r.user.me()
  22. print(authenticated_user.name, authenticated_user.link_karma)
Add Comment
Please, Sign In to add comment