prototyping
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
import requests
|
||||
import requests.auth
|
||||
import json
|
||||
CLIENT_ID = "0U8ldg0566wsdjrf7lUDlQ"
|
||||
CLIENT_SECRET = "xq7JLuAlVAWun0p_LqOfS3gyCjgN8A"
|
||||
CLIENT_ID = "wRuNZ_TWBQhcN-uQxfajPA"
|
||||
CLIENT_SECRET = "ue20Q8ev6Z6Fa9r-PN_TETf-YItXoA"
|
||||
|
||||
CODE = "code"
|
||||
URI = "uri"
|
||||
GRANT_TYPE = "password"
|
||||
USERNAME = "ExplodingLlama"
|
||||
PASSWORD = "p9nyHFftTPDN0XkzoPYN"
|
||||
VERSION = "0.0.1"
|
||||
AGENT = f"python:com.llamallama.earthporn_analyzer:v{VERSION} (by /u/ExplodingLlama)"
|
||||
client_auth = requests.auth.HTTPBasicAuth(CLIENT_ID, CLIENT_SECRET)
|
||||
post_data = {"grant_type": "authorization_code", "code": {CODE}, "redirect_uri": {URI}}
|
||||
headers = {"User-Agent": "python:com.llamallama.earthporn_analyzer:v0.0.1 (by /u/explodingllama)"}
|
||||
#post_data = {"grant_type": GRANT_TYPE, "code": {CODE}, "redirect_uri": {URI}}
|
||||
post_data = {"grant_type": GRANT_TYPE, "username": USERNAME, "password": PASSWORD}
|
||||
headers = {"User-Agent": AGENT}
|
||||
response = requests.post("https://www.reddit.com/api/v1/access_token", auth=client_auth, data=post_data, headers=headers )
|
||||
print(response.json())
|
||||
response_json = response.json()
|
||||
|
||||
Reference in New Issue
Block a user