Skip to content

Commit 0ef218d

Browse files
committed
replace hardcoded server with configurable server name
Fixing requested change
1 parent bc7a468 commit 0ef218d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/requests_api_mastodon.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# Login to your mastodon server in a browser, visit your profile, UserID is in the URL.
1616
# Example: https://mastodon.YOURSERVER/web/accounts/YOURUSERIDISHERE
1717

18+
Mastodon_Server = "mastodon.social" # Set server instance
1819
Mastodon_UserID = "000000000000000000" # Set User ID you want endpoints from
1920
# Test in browser first, this will pull up a JSON webpage
2021
# https://mastodon.YOURSERVER/api/v1/accounts/YOURUSERIDHERE/statuses?limit=1
@@ -53,8 +54,11 @@ def time_calc(input_time):
5354

5455

5556
# Publicly available data no header required
56-
MAST_SOURCE = (
57-
"https://mastodon.cloud/api/v1/accounts/" + Mastodon_UserID + "/statuses?limit=1"
57+
MAST_SOURCE = ("https://"
58+
+ Mastodon_Server
59+
+ "/api/v1/accounts/"
60+
+ Mastodon_UserID
61+
+ "/statuses?limit=1"
5862
)
5963

6064
# Connect to Wi-Fi

0 commit comments

Comments
 (0)