You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to propose an improvement to __yrno() function in weather.sh. Currently, the argument passed into $jsonparser is incorrect, resulting in the weather not displaying.
This fails because .properties.timeseries[0] is not valid. You can verify this yourself by running the following: curl --max-time 4 -s "https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=$LAT&lon=$LON" | jq -r .properties.timeseries[0]
with any $LAT and $LON.
I have checked that the code is valid with the following: curl --max-time 4 -s "https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=$LAT&lon=$LON" | jq -r '.properties.timeseries | .[0].data.instant.details.air_temperature' As this does return the correct temperature.
Request
I’d be happy to submit a Pull Request with the implementation. Let me know your thoughts!
Thanks for considering this suggestion!
The text was updated successfully, but these errors were encountered:
Hi,
I'd like to propose an improvement to
__yrno()
function in weather.sh. Currently, the argument passed into$jsonparser
is incorrect, resulting in the weather not displaying.Current implementation
In
__yrno()
, we haveThis fails because
.properties.timeseries[0]
is not valid. You can verify this yourself by running the following:curl --max-time 4 -s "https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=$LAT&lon=$LON" | jq -r .properties.timeseries[0]
with any
$LAT
and$LON
.Proposed change
Instead, we can do the following:
Verification of Code Validity
I have checked that the code is valid with the following:
curl --max-time 4 -s "https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=$LAT&lon=$LON" | jq -r '.properties.timeseries | .[0].data.instant.details.air_temperature'
As this does return the correct temperature.Request
I’d be happy to submit a Pull Request with the implementation. Let me know your thoughts!
Thanks for considering this suggestion!
The text was updated successfully, but these errors were encountered: