Skip to content

Instantly share code, notes, and snippets.

@xiongchiamiov
Created July 14, 2015 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiongchiamiov/d6a4b3db757b5c7e9fd8 to your computer and use it in GitHub Desktop.
Save xiongchiamiov/d6a4b3db757b5c7e9fd8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import requests
from constants import *
auth = requests.auth.HTTPBasicAuth(client_id, client_secret)
data = {
'grant_type': 'password',
'username': username,
'password': password,
'device_id': 5,
'duration': 'permanent',
}
headers = {'User-Agent': user_agent}
r = requests.post('https://reddit.local:8001/api/v1/access_token',
auth=auth, data=data, headers=headers, verify=False)
print r
print r.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment