3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-06 03:59:31 +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 = ( my %cache_opt = (
'namespace' => 'wttr', 'namespace' => 'wttr',
'default_expires_in' => 3600 'default_expires_in' => 900
); );
my $location_uri = uri_escape_utf8 $location; my $location_uri = uri_escape_utf8 $location;
@ -287,8 +287,7 @@ sub get_wttr {
when ('sun') { when ('sun') {
my $a = $w->{'astronomy'}->[0]; 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"; } when ('sunhours') { $result .= "Hours of sun: $w->{'sunHour'};\n"; }