new weather script alltogether

This commit is contained in:
Maximilian Wagner
2024-06-25 21:16:36 +02:00
parent 8fad648a6e
commit da5ddaa09d
3 changed files with 11 additions and 1 deletions

9
scripts/weather.py Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/python3
import requests
import sys
req = requests.get(f'https://wttr.in/{sys.argv[1]}?format="%t:%c:%C"').text[1:-1].split(':')
print('{' + f'"text": "{req[0]} {req[1]}", "tooltip": "", "class": "{req[2]}"' + '}')

1
scripts/weather_new.sh Normal file
View File

@@ -0,0 +1 @@
#!/bin/bash