diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index 0a47a49..cad5722 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -369,7 +369,7 @@ data: - type: custom-api url: https://www.idokep.hu/idojaras/Budapest cache: 15m - skip-json-validation: true # CRITICAL: Fixes the JSON error + skip-json-validation: true # Mandatory for HTML scraping style: grid-column: span 4 grid-row: span 3 @@ -383,56 +383,89 @@ data: {{ $sunset := findSubmatch `Napnyugta ([0-9:]+)` $body }} -
-
+
+ {{/* Current Section */}} +
-
Budapest
-
{{ now | formatTime "Monday, Jan 02" }}
-
-
-
↑ {{ $sunrise }}
-
↓ {{ $sunset }}
+
Budapest
+
{{ $temp }}°
+
{{ $cond }}
+
+ ↑ {{ $sunrise }} + ↓ {{ $sunset }} +
+ weather
-
- icon -
-
{{ $temp }}°
-
{{ $cond }}
-
-
- -
- {{/* Loop through daily forecast columns found in the HTML */}} - {{ $dayBlocks := findAllMatches `(?s)
.*?
` $body }} - {{ range $i, $block := $dayBlocks }} - {{ if lt $i 5 }} {{/* Show only next 5 days */}} + {{/* Daily Forecast Section */}} +
+ {{/* findMatches returns a slice of the daily forecast columns */}} + {{ $blocks := findMatches `(?s)
.*?
` $body }} + {{ range $i, $block := $blocks }} + {{ if lt $i 5 }} {{/* Display only the next 5 days */}} {{ $d_num := findSubmatch `dfDayNum">([0-9]+)` $block }} {{ $d_name := findSubmatch `dfDay">([^<]+)` $block }} {{ $d_icon := findSubmatch `src="([^"]+)"` $block }} - {{ $d_max := findSubmatch `max[^>]+>([^<]+)` $block }} - {{ $d_min := findSubmatch `min[^>]+>([^<]+)` $block }} + {{ $d_max := findSubmatch `max">([^<]+)` $block }} + {{ $d_min := findSubmatch `min">([^<]+)` $block }} -
- {{ $d_num }} {{ $d_name }} - - {{ $d_min }}° -
- {{ $d_max }}° +
+ {{ $d_num }} {{ $d_name }} + + {{ $d_min }}° +
+
+
+ {{ $d_max }}°
{{ end }} {{ end }}
+ + {{/* Footer Link */}} +
# Calendar Widget