This commit is contained in:
@ -21,13 +21,9 @@ headers = {
|
|||||||
"Authorization": f"Bearer {dogfacts_token}"
|
"Authorization": f"Bearer {dogfacts_token}"
|
||||||
}
|
}
|
||||||
|
|
||||||
print(botsy_token, bots_endpoint, post_endpoint)
|
|
||||||
print(api_url)
|
|
||||||
print(po_user_token, po_test_token)
|
|
||||||
response = get(api_url)
|
response = get(api_url)
|
||||||
if response.reason == "OK":
|
if response.reason == "OK":
|
||||||
dog_fact = DefaultMunch.fromDict(loads(response.text)['data'][0])
|
dog_fact = DefaultMunch.fromDict(loads(response.text)['data'][0])
|
||||||
print(dog_fact)
|
|
||||||
payload = {"status": f"didja know: \n {dog_fact.attributes.body}\n#RandomDogFacts", "visibility": "unlisted"}
|
payload = {"status": f"didja know: \n {dog_fact.attributes.body}\n#RandomDogFacts", "visibility": "unlisted"}
|
||||||
response = post(post_endpoint, headers=headers, json=payload)
|
response = post(post_endpoint, headers=headers, json=payload)
|
||||||
if response.reason == "OK":
|
if response.reason == "OK":
|
||||||
|
Reference in New Issue
Block a user