3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-05 19:49:32 +01:00

Plugin/Wttr: add sunHour and uvIndex to -sun; decrease cache timeout from 1hr to 15m

This commit is contained in:
Pragmatic Software 2023-01-21 23:32:14 -08:00
parent d8803a4c29
commit d29ec9b6b9

View File

@ -109,7 +109,7 @@ sub get_wttr {
my %cache_opt = (
'namespace' => 'wttr',
'default_expires_in' => 3600
'default_expires_in' => 900
);
my $location_uri = uri_escape_utf8 $location;
@ -287,8 +287,7 @@ sub get_wttr {
when ('sun') {
my $a = $w->{'astronomy'}->[0];
$result .= "Sun: rise: $a->{'sunrise'}, set: $a->{'sunset'};\n";
}
$result .= "Sun: rise: $a->{'sunrise'}, set: $a->{'sunset'}; hours: $w->{'sunHour'}; UV Index: $c->{'uvIndex'};\n";}
when ('sunhours') { $result .= "Hours of sun: $w->{'sunHour'};\n"; }