fetch
This commit is contained in:
parent
12a14f1a26
commit
1cd71c8dab
1 changed files with 8 additions and 2 deletions
10
fetch.py
10
fetch.py
|
@ -1,8 +1,14 @@
|
|||
import requests
|
||||
import json
|
||||
|
||||
with open('config.json', 'r') as f:
|
||||
config = json.load(f)
|
||||
|
||||
def fetchQuote(quoteId):
|
||||
quote = requests.get("https://quotes.everypizza.im/image/" + quoteId)
|
||||
processedId = config['imag']['server'] + quoteId
|
||||
quote = requests.get(processedId)
|
||||
if quote.status_code == 200:
|
||||
return quote.content
|
||||
# return quote.content
|
||||
return
|
||||
else:
|
||||
return None
|
||||
|
|
Loading…
Add table
Reference in a new issue