From c4d30963bb32f0bb776978e9acbe4f6c1f79bf4e Mon Sep 17 00:00:00 2001 From: Naypam Date: Tue, 15 Dec 2015 10:17:25 +0000 Subject: [PATCH] Ignore vim swap files --- .gitignore | 1 + oauth_test.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 oauth_test.py 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) +