Skip to content

Commit

Permalink
major: Add support for qote api token from They Said So
Browse files Browse the repository at this point in the history
  • Loading branch information
lmatter committed Jan 20, 2024
1 parent 43427fb commit e356324
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inkyshot/update-display.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ def temp_to_str(temp, scale):
BALENA_DEVICE_UUID = os.environ["BALENA_DEVICE_UUID"]
BALENA_SUPERVISOR_ADDRESS = os.environ["BALENA_SUPERVISOR_ADDRESS"]
BALENA_SUPERVISOR_API_KEY = os.environ["BALENA_SUPERVISOR_API_KEY"]
QUOTE_API_TOKEN = os.environ["QUOTE_API_TOKEN"]

WAVESHARE = True if "WAVESHARE" in os.environ else False

Expand Down Expand Up @@ -353,7 +354,7 @@ def temp_to_str(temp, scale):
try:
response = requests.get(
f"https://quotes.rest/qod?category={CATEGORY}&language={LANGUAGE}",
headers={"Accept" : "application/json"}
headers = {"Accept": "application/json", "Authorization": f"Bearer {QUOTE_API_TOKEN}"}
)
data = response.json()
message = data['contents']['quotes'][0]['quote']
Expand Down

0 comments on commit e356324

Please sign in to comment.