Skip to content

Commit 88d94c0

Browse files
authored
PyPortal_Word_Of_the_Day: update to settings.toml
1 parent 76cd05b commit 88d94c0

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

  • PyPortal/PyPortal_Word_of_the_Day

PyPortal/PyPortal_Word_of_the_Day/code.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@
88
will appear automatically on the display. Tap the screen to start
99
as well as to switch between the word's definition and an example sentence.
1010
"""
11+
import os
1112

1213
import board
1314
from adafruit_pyportal import PyPortal
1415

15-
# Get wifi details and more from a secrets.py file
16-
try:
17-
from secrets import secrets
18-
except ImportError:
19-
print("WiFi settings are kept in settings.py, please add them there!")
20-
raise
21-
2216
# Set up where we'll be fetching data from
23-
DATA_SOURCE = "https://api.wordnik.com/v4/words.json/wordOfTheDay?api_key="+secrets['wordnik_token']
17+
DATA_SOURCE = "https://api.wordnik.com/v4/words.json/wordOfTheDay?api_key=" + os.getenv("WORDNIK_TOKEN")
2418
PART_OF_SPEECH = ['definitions', 0, 'partOfSpeech']
2519
DEF_LOCATION = ['definitions', 0, 'text']
2620
EXAMPLE_LOCATION = ['examples', 0, 'text']

0 commit comments

Comments
 (0)