File tree Expand file tree Collapse file tree
PyPortal/PyPortal_Word_of_the_Day Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88will appear automatically on the display. Tap the screen to start
99as well as to switch between the word's definition and an example sentence.
1010"""
11+ import os
1112
1213import board
1314from 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" )
2418PART_OF_SPEECH = ['definitions' , 0 , 'partOfSpeech' ]
2519DEF_LOCATION = ['definitions' , 0 , 'text' ]
2620EXAMPLE_LOCATION = ['examples' , 0 , 'text' ]
You can’t perform that action at this time.
0 commit comments