diff --git a/Plugins/Weather.pm b/Plugins/Weather.pm index 16eaa60d..03615629 100644 --- a/Plugins/Weather.pm +++ b/Plugins/Weather.pm @@ -14,7 +14,7 @@ use strict; use feature 'unicode_strings'; -use LWP::UserAgent::WithCache; +use PBot::Utils::LWPUserAgentCached; use XML::LibXML; use Getopt::Long qw(GetOptionsFromString); use Carp (); @@ -83,7 +83,7 @@ sub get_weather { 'default_expires_in' => 3600 ); - my $ua = LWP::UserAgent::WithCache->new(\%cache_opt, timeout => 10); + my $ua = PBot::Utils::LWPUserAgentCached->new(\%cache_opt, timeout => 10); my $response = $ua->get("http://rss.accuweather.com/rss/liveweather_rss.asp?metric=0&locCode=$location"); my $xml; diff --git a/Plugins/Wttr.pm b/Plugins/Wttr.pm index 1efea2d2..4f568b75 100644 --- a/Plugins/Wttr.pm +++ b/Plugins/Wttr.pm @@ -18,7 +18,7 @@ use utf8; use feature 'switch'; no if $] >= 5.018, warnings => "experimental::smartmatch"; -use LWP::UserAgent::WithCache; +use PBot::Utils::LWPUserAgentCached; use JSON; use Getopt::Long qw(GetOptionsFromString); use URI::Escape qw/uri_escape_utf8/; @@ -121,7 +121,7 @@ sub get_wttr { my $location_uri = uri_escape_utf8 $location; - my $ua = LWP::UserAgent::WithCache->new(\%cache_opt, timeout => 10); + my $ua = PBot::Utils::LWPUserAgentCached->new(\%cache_opt, timeout => 10); my $response = $ua->get("http://wttr.in/$location_uri?format=j1&m"); my $json;