changed quotes API
This commit is contained in:
parent
f786f29141
commit
0ee1c17a07
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@ import random
|
||||||
from util import logging
|
from util import logging
|
||||||
|
|
||||||
def fetch_quote() -> tuple:
|
def fetch_quote() -> tuple:
|
||||||
url = "https://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en"
|
url = "https://favqs.com/api/qotd"
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
|
|
||||||
if not response.ok:
|
if not response.ok:
|
||||||
|
@ -11,4 +11,4 @@ def fetch_quote() -> tuple:
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
data = response.json()
|
data = response.json()
|
||||||
return (data["quoteText"], data["quoteAuthor"])
|
return (data["quote"]["body"], data["quote"]["author"])
|
Loading…
Add table
Add a link
Reference in a new issue