1

Another bits of refactoring, code-style fixes, etc

This commit is contained in:
Sergei Fedosov
2021-02-08 18:01:03 +03:00
parent 96b861b507
commit c619e47560
20 changed files with 82 additions and 93 deletions

View File

@@ -15,10 +15,9 @@ use JSON::XS;
use conf qw (loadConf);
use util qw (trim urlencode);
use vars qw/$VERSION/;
use version; our $VERSION = qw (1.0);
use Exporter qw (import);
our @EXPORT_OK = qw (weather);
$VERSION = '1.0';
my $c = loadConf ();
@@ -98,7 +97,7 @@ sub __weather {
};
# lookup cache
if (defined ($cachetime{$id}) && ($now - $cachetime{$id}) < 10800) {
if (defined ($cachetime{$id}) && (($now - $cachetime{$id}) < 10800)) {
$fc = decode_json ($cachedata{$id});
} else {
my $r;
@@ -141,7 +140,7 @@ sub __weather {
untie %cachetime;
untie %cachedata;
# TODO: check all of this for existance
# TODO: check all of this for existence
$w->{'name'} = $fc->{name};
$w->{'state'} = $fc->{state};
$w->{'country'} = $fc->{sys}->{country};