mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 13:59:47 +01:00
Plugins/Wttr: improvements
This commit is contained in:
parent
28f102d88c
commit
2071fe2523
@ -134,7 +134,7 @@ sub get_weather {
|
|||||||
|
|
||||||
# title-case location
|
# title-case location
|
||||||
$location = ucfirst lc $location;
|
$location = ucfirst lc $location;
|
||||||
$location =~ s/(?: |\.)(\w)/' ' . uc $1/ge;
|
$location =~ s/( |\.)(\w)/$1 . uc $2/ge;
|
||||||
|
|
||||||
my $result = "Weather for $location: ";
|
my $result = "Weather for $location: ";
|
||||||
|
|
||||||
@ -202,16 +202,16 @@ sub get_weather {
|
|||||||
|
|
||||||
when ('chances') {
|
when ('chances') {
|
||||||
$result .= "Chances of: ";
|
$result .= "Chances of: ";
|
||||||
$result .= "Fog: $h->{'chanceoffog'}, " if $h->{'chanceoffog'};
|
$result .= "Fog: $h->{'chanceoffog'}%, " if $h->{'chanceoffog'};
|
||||||
$result .= "Frost: $h->{'chanceoffrost'}, " if $h->{'chanceoffrost'};
|
$result .= "Frost: $h->{'chanceoffrost'}%, " if $h->{'chanceoffrost'};
|
||||||
$result .= "High temp: $h->{'chanceofhightemp'}, " if $h->{'chanceofhightemp'};
|
$result .= "High temp: $h->{'chanceofhightemp'}%, " if $h->{'chanceofhightemp'};
|
||||||
$result .= "Overcast: $h->{'chanceofovercast'}, " if $h->{'chanceofovercast'};
|
$result .= "Overcast: $h->{'chanceofovercast'}%, " if $h->{'chanceofovercast'};
|
||||||
$result .= "Rain: $h->{'chanceofrain'}, " if $h->{'chanceofrain'};
|
$result .= "Rain: $h->{'chanceofrain'}%, " if $h->{'chanceofrain'};
|
||||||
$result .= "Remaining dry: $h->{'chanceofremdry'}, " if $h->{'chanceofremdry'};
|
$result .= "Remaining dry: $h->{'chanceofremdry'}%, " if $h->{'chanceofremdry'};
|
||||||
$result .= "Snow: $h->{'chanceofsnow'}, " if $h->{'chanceofsnow'};
|
$result .= "Snow: $h->{'chanceofsnow'}%, " if $h->{'chanceofsnow'};
|
||||||
$result .= "Sunshine: $h->{'chanceofsunshine'}, " if $h->{'chanceofsunshine'};
|
$result .= "Sunshine: $h->{'chanceofsunshine'}%, " if $h->{'chanceofsunshine'};
|
||||||
$result .= "Thunder: $h->{'chanceofthunder'}, " if $h->{'chanceofthunder'};
|
$result .= "Thunder: $h->{'chanceofthunder'}%, " if $h->{'chanceofthunder'};
|
||||||
$result .= "Windy: $h->{'chanceofwindy'}, " if $h->{'chanceofwindy'};
|
$result .= "Windy: $h->{'chanceofwindy'}%, " if $h->{'chanceofwindy'};
|
||||||
$result =~ s/,\s+$/; /;
|
$result =~ s/,\s+$/; /;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user