prototyping
This commit is contained in:
@@ -1,14 +1,20 @@
|
|||||||
import requests
|
import requests
|
||||||
import requests.auth
|
import requests.auth
|
||||||
import json
|
import json
|
||||||
CLIENT_ID = "0U8ldg0566wsdjrf7lUDlQ"
|
CLIENT_ID = "wRuNZ_TWBQhcN-uQxfajPA"
|
||||||
CLIENT_SECRET = "xq7JLuAlVAWun0p_LqOfS3gyCjgN8A"
|
CLIENT_SECRET = "ue20Q8ev6Z6Fa9r-PN_TETf-YItXoA"
|
||||||
|
|
||||||
CODE = "code"
|
CODE = "code"
|
||||||
URI = "uri"
|
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)
|
client_auth = requests.auth.HTTPBasicAuth(CLIENT_ID, CLIENT_SECRET)
|
||||||
post_data = {"grant_type": "authorization_code", "code": {CODE}, "redirect_uri": {URI}}
|
#post_data = {"grant_type": GRANT_TYPE, "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, "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 )
|
response = requests.post("https://www.reddit.com/api/v1/access_token", auth=client_auth, data=post_data, headers=headers )
|
||||||
print(response.json())
|
print(response.json())
|
||||||
response_json = response.json()
|
response_json = response.json()
|
||||||
|
|||||||
Reference in New Issue
Block a user