response.json instead of json.loads
All checks were successful
ReleaseBot / deploy (push) Successful in 31s
QuipBot / deploy (push) Successful in 15s
QuotesBot / deploy (push) Successful in 24s
DogFacts / deploy (push) Successful in 16s
PuppyBot / deploy (push) Successful in 26s

This commit is contained in:
2025-07-24 14:12:48 -05:00
parent 7315264346
commit 506fa996fd
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,8 @@ from munch import DefaultMunch
bh_hdr = {'x-api-key': blackhistory_api, 'Content-Type': 'application/json'}
blackhistory_fact = DefaultMunch.fromDict(loads(get(blackhistory_endpoint, headers=bh_hdr).text)['data'][0])
# blackhistory_fact = DefaultMunch.fromDict(loads(get(blackhistory_endpoint, headers=bh_hdr).text)['data'][0])
blackhistory_fact = DefaultMunch.fromDict(get(blackhistory_endpoint, headers=bh_hdr).json()['data'][0])
post_text = f"{blackhistory_fact.text}. \n Event Date: {blackhistory_fact.date_of_event}\nSource: {blackhistory_fact.source_references[0].source_url}\n#BlackHistoryFacts"
post_hdr = {'Authorization': 'Bearer ' + botsy_token}