mirror of
https://codeberg.org/herrthees/ODW-Abfallkalender-Bot-Demo.git
synced 2025-08-01 16:17:34 +00:00
Kommentare verbessert
This commit is contained in:
parent
ca4bb11b7e
commit
a747976953
1 changed files with 8 additions and 2 deletions
|
@ -7,10 +7,13 @@ import requests
|
|||
# Morgiges Datum für API-Abfrage und der Name des Wochentags in Deutsch
|
||||
# Sprache auf Deutsch setzen, für die Namen der Wochentage
|
||||
locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8')
|
||||
# Einen Tag auf das heutige Datum addieren
|
||||
|
||||
# Einen Tag auf das heutige Datum addieren in der UTC-Zeitangabe
|
||||
utcMorgen = datetime.today()+timedelta(days=1)
|
||||
# Das Datum im Format für die Open-Data-API, z.B. 2022-07-13
|
||||
|
||||
# Das UTC-Datum im Format für die Open-Data-API, z.B. 2022-07-13
|
||||
morgen = utcMorgen.strftime('%Y-%m-%d')
|
||||
|
||||
# Der Wochentagname von morgen
|
||||
morgenWochentag = utcMorgen.strftime('%A')
|
||||
|
||||
|
@ -34,6 +37,9 @@ abfallkalenderApiUrl = 'https://opendata.wuerzburg.de/api/records/1.0/search/?da
|
|||
apiAntwort = requests.get(abfallkalenderApiUrl)
|
||||
abfallkalender = apiAntwort.json()
|
||||
|
||||
# Zu Testzwecken: Gibt das Dictionary aus
|
||||
print (abfallkalender)
|
||||
|
||||
# Gibt es Daten für den morgigen Tag (Samstag und Sonntag nicht)
|
||||
if len(abfallkalender['records']) > 0:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue