Introduce cachedir config pragma, move karma to CHI

* Move karma from homebrew storage to CHI
* Use cachedir for CHI file storage heap
* Use cachedir in drink.pm
* Use cachedir in weather.pm
This commit is contained in:
eleksir
2021-04-05 16:25:56 +03:00
parent 57dee8b168
commit cec3ed66fb
4 changed files with 34 additions and 68 deletions

View File

@@ -22,6 +22,7 @@ use Exporter qw (import);
our @EXPORT_OK = qw (weather);
my $c = loadConf ();
my $cachedir = $c->{cachedir};
sub weather {
my $city = shift;
@@ -74,7 +75,6 @@ sub __weather {
my $city = shift;
$city = urlencode $city;
my $appid = $c->{openweathermap}->{appid};
my $cachedir = $c->{openweathermap}->{cachedir};
my $now = time ();
my $fc;
my $w;