You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Shreddit/oauth_test.py

18 lines
286 B

#!/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)