Skip to content

update .env references to settings.toml #2368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
# connect to SSID
wifi.radio.connect(os.getenv('WIFI_SSID'), os.getenv('WIFI_PASSWORD'))

# add your mastodon token as 'mastodon_token' to your .env file
# add your mastodon token as 'mastodon_token' to your settings.toml file
headers = {'Authorization': 'Bearer ' + os.getenv('mastodon_token') + 'read:statuses'}

pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())

# initial request, gets most recent matching hashtag post
# add your mastodon instance (mastodon.social, tech.lgbt, etc) to your .env file as mastodon_host
# add your mastodon instance (mastodon.social, tech.lgbt, etc)
# to your settings.toml file as mastodon_host
r = requests.get("https://%s/api/v1/timelines/tag/%s?limit=1" % (os.getenv('mastodon_host'), hashtag), headers=headers) # pylint: disable=line-too-long
json_data = r.json()
post_id = str(json_data[0]['id'])
Expand Down
4 changes: 2 additions & 2 deletions CircuitPython_Mastodon_API_Examples/Send_To_Mastodon/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import socketpool
import adafruit_requests

# add your mastodon token as 'mastodon_token' to your .env file
# add your mastodon token as 'mastodon_token' to your settings.toml file
headers = {'Authorization': 'Bearer ' + os.getenv('mastodon_token')}

# add your mastodon instance to your .env file as mastodon_host
# add your mastodon instance to your settings.toml file as mastodon_host
url = 'https://' + os.getenv('mastodon_host') + '/api/v1/statuses'

# connect to SSID
Expand Down
2 changes: 1 addition & 1 deletion Scrolling_Alphanumeric_Countdown_Clock/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
CircuitPython Quad-Alphanumeric Display Holiday Countdown.

This demo requires a separate file named .env (including the dot) on your CIRCUITPY drive, which
This demo requires a separate file named settings.toml on your CIRCUITPY drive, which
should contain your WiFi credentials and Adafruit IO credentials.
"""

Expand Down