Skip to content

Commit 05b4d3b

Browse files
authored
PyPortal_Thingiverse: update to settings.toml
1 parent 76cd05b commit 05b4d3b

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

  • PyPortal/PyPortal_Thingiverse

PyPortal/PyPortal_Thingiverse/code.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5+
import os
56
import time
67
import random
78
import board
89
import adafruit_pyportal
910

10-
# Get wifi details and more from a settings.py file
11-
try:
12-
from secrets import secrets
13-
except ImportError:
14-
print("WiFi secrets are kept in secrets.py, please add them there!")
15-
raise
16-
1711
# Set up where we'll be fetching data from
1812
NUM_THINGS=25 # how many things to select from (we randomize between em)
1913
DATA_SOURCE = "https://api.thingiverse.com/users/adafruit/things?per_page="+str(NUM_THINGS)
20-
DATA_SOURCE += "&access_token=" + secrets['thingiverse_token']
14+
DATA_SOURCE += "&access_token=" + os.getenv("THINGIVERSE_TOKEN")
2115
IMAGE_LOCATION = [0, "thumbnail"]
2216
TITLE_LOCATION = [0, "name"]
2317
URL_LOCATION = [0, "public_url"]

0 commit comments

Comments
 (0)