diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index cad5722..926d6fe 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -369,102 +369,102 @@ data: - type: custom-api url: https://www.idokep.hu/idojaras/Budapest cache: 15m - skip-json-validation: true # Mandatory for HTML scraping + skip-json-validation: true style: grid-column: span 4 grid-row: span 3 template: | - {{/* 1. Extract Current Weather Data */}} + {{/* 1. Extract Body and Current Data */}} {{ $body := .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 }} - + {{ $temp := findSubmatch "current-temperature\">([^˚<]+)" $body | trimSpace }} + {{ $cond := findSubmatch "current-weather\">([^<]+)" $body | trimSpace }} + {{ $icon := findSubmatch "forecast-bigicon\"[^>]+src=\"([^\"]+)\"" $body }} + {{ $sunrise := findSubmatch "Napkelte ([0-9:]+)" $body }} + {{ $sunset := findSubmatch "Napnyugta ([0-9:]+)" $body }} + + {{/* 2. Split HTML by the Forecast Column class to get daily blocks */}} + {{ $parts := split $body "