feature: add hourly forecast, precipitation, and icon hints to weather extractor #52
Reference in New Issue
Block a user
Delete Branch "feature/weather-hourly-precip-icons"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds missing fields to the DuckDuckGo weather extractor as described in #51:
HourlyForecaststruct withTime,Temp,Condition,Precipitation, andIconHintfields. Extracted via.module__hourly-itemelements.Precipitation intfield to bothDayForecastandHourlyForecast. Uses -1 sentinel for "unavailable" (matches mort's convention).IconHint stringfield to both structs. Reads icon type from elementaria-label,title, oraltattributes (in priority order), providing reliable weather categorization (e.g., "PartlyCloudy", "Snow", "MostlyCloudy").Struct changes
New helper
extractIconHint(nodes)reads icon type from aria-label > title > alt attribute priority chain, matching the same approach used in mort'sweather2module.Test plan
TestExtractWeather- updated with hourly items, precipitation, and icon hintsTestGetWeather_MockBrowser- verifies hourly data flows through full pathTestExtractWeather_Empty- verifies zero hourly data on empty docTestExtractWeather_NoPrecipitation- verifies -1 sentinel when no precip elementTestExtractIconHint_Priority- verifies aria-label > title > alt fallback chaingo test ./...)Closes #51