diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index c22cc51..0a47a49 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -369,84 +369,69 @@ data: - type: custom-api url: https://www.idokep.hu/idojaras/Budapest cache: 15m + skip-json-validation: true # CRITICAL: Fixes the JSON error style: grid-column: span 4 grid-row: span 3 template: | - {{/* 1. Extract Current Data */}} + {{/* 1. Extract Current Weather Data */}} {{ $body := .Body }} - {{ $temp := findSubmatch `(?s)current-temperature">([^˚<]+)` $body | trimSpace }} - {{ $cond := findSubmatch `(?s)current-weather">([^<]+)` $body | trimSpace }} - {{ $icon := findSubmatch `(?s)forecast-bigicon"[^>]+src="([^"]+)"` $body }} + {{ $temp := findSubmatch `current-temperature">([^˚<]+)` $body }} + {{ $cond := findSubmatch `current-weather">([^<]+)` $body }} + {{ $icon := findSubmatch `forecast-bigicon"[^>]+src="([^"]+)"` $body }} {{ $sunrise := findSubmatch `Napkelte ([0-9:]+)` $body }} {{ $sunset := findSubmatch `Napnyugta ([0-9:]+)` $body }} - {{/* 2. Extract Daily Forecast (Regex patterns for specific day indices) */}} - {{/* Day 1 */}} - {{ $d1_pat := `(?s)dailyForecastCol.*?dfDayNum">([0-9]+).*?dfDay">([^<]+).*?src="([^"]+)".*?max[^>]+>([^<]+).*?min[^>]+>([^<]+)` }} - {{ $d1_num := findSubmatch $d1_pat $body }} - {{ $d1_day := index (findSubmatch $d1_pat $body) 1 }} - {{ $d1_icon := index (findSubmatch $d1_pat $body) 2 }} - {{ $d1_max := index (findSubmatch $d1_pat $body) 3 }} - {{ $d1_min := index (findSubmatch $d1_pat $body) 4 }} - - {{/* Day 2 (skipping 1 column) */}} - {{ $d2_pat := `(?s)dailyForecastCol.*?dailyForecastCol.*?dfDayNum">([0-9]+).*?dfDay">([^<]+).*?src="([^"]+)".*?max[^>]+>([^<]+).*?min[^>]+>([^<]+)` }} - {{ $d2_day := index (findSubmatch $d2_pat $body) 1 }} - {{ $d2_icon := index (findSubmatch $d2_pat $body) 2 }} - {{ $d2_max := index (findSubmatch $d2_pat $body) 3 }} - {{ $d2_min := index (findSubmatch $d2_pat $body) 4 }} - -