1
0
Fork 0
quotes-bot-python/fetch.py

15 lines
317 B
Python
Raw Normal View History

2025-01-31 18:39:10 -06:00
import requests
2025-01-31 19:03:35 -06:00
import json
with open('config.json', 'r') as f:
config = json.load(f)
2025-01-31 18:39:10 -06:00
2025-01-31 18:58:23 -06:00
def fetchQuote(quoteId):
2025-01-31 19:03:35 -06:00
processedId = config['imag']['server'] + quoteId
quote = requests.get(processedId)
2025-01-31 18:58:45 -06:00
if quote.status_code == 200:
2025-01-31 19:03:35 -06:00
# return quote.content
return
2025-01-31 18:58:23 -06:00
else:
return None