Update Dashblock_API to settings.toml

This commit is contained in:
Dan Halbert 2024-04-09 13:16:12 -04:00 committed by GitHub
parent 76cd05be8f
commit e45243f024
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,19 +8,13 @@ Use Dashblock to create a custom API for learn.adafruit.com,
then display the number of learn guides on the site
"""
import os
import time
import board
from adafruit_pyportal import PyPortal
# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi settings are kept in settings.py, please add them there!")
raise
# Set up where we'll be fetching data from
DATA_SOURCE = "https://api.dashblock.io/model/v1?api_key=" + secrets['dashblock_key']
DATA_SOURCE = "https://api.dashblock.io/model/v1?api_key=" + os.getenv("DASHBLOCK_KEY")
GUIDE_COUNT = ['entities', 0, 'guide count']
CAPTION = 'total tutorials:'