diff options
author | Jesse Luehrs <doy@tozt.net> | 2023-07-16 01:25:29 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2023-07-16 01:25:29 -0400 |
commit | 7772131ad274692d7fb71bd8f69241df661835e8 (patch) | |
tree | 183b022fe3bcb6d8454fed1d2098edd815aa36bf /bin | |
parent | e1d8526040f9bb6b4e84059145e0548f80929165 (diff) | |
download | conf-7772131ad274692d7fb71bd8f69241df661835e8.tar.gz conf-7772131ad274692d7fb71bd8f69241df661835e8.zip |
fix weather time zone
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/hornet/weather | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/hornet/weather b/bin/hornet/weather index c47301c..1cbbffb 100755 --- a/bin/hornet/weather +++ b/bin/hornet/weather @@ -19,8 +19,10 @@ if (length($location) == 5) { $location = zip_location($location); } (my $lat, my $lon) = split ',', $location; +my $tz = readlink("/etc/localtime"); +$tz =~ s{^/usr/share/zoneinfo/}{}; -my $data = slurp_http("https://api.open-meteo.com/v1/forecast?latitude=$lat&longitude=$lon¤t_weather=true&hourly=temperature_2m,apparent_temperature,precipitation_probability"); +my $data = slurp_http("https://api.open-meteo.com/v1/forecast?latitude=$lat&longitude=$lon&timezone=$tz¤t_weather=true&hourly=temperature_2m,apparent_temperature,precipitation_probability"); my $time = $data->{current_weather}{time}; my $hourly = $data->{hourly}; my @forecast; |