diff --git a/.gitignore b/.gitignore index 83901b0..b25344d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ pip-selfcheck.json shreddit.conf praw.ini __pycache__/ +.*.swp diff --git a/oauth_test.py b/oauth_test.py new file mode 100644 index 0000000..563d0c6 --- /dev/null +++ b/oauth_test.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +''' +Simple script to check if your oauth is working. +''' +import praw +import sys + +r = praw.Reddit('Shreddit oauth test') +try: + r.refresh_access_information() + if r.is_oauth_session(): + sys.exit(0) + else: + sys.exit(2) +except: + sys.exit(1) +