summaryrefslogtreecommitdiff
path: root/driver-async.pl
blob: c1583150c04330a68114e084c079ad5c2c490e27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env perl 
use strict;
use warnings;
use 5.014;
use lib 'local/lib/perl5';
use lib 'lib';
use HomePanel::Driver;
use Path::Tiny;
use Config::Any;
 
my $cfg_set = Config::Any->load_files({
    files => \@ARGV,
    use_ext => 1,
});
 
my %config = map { %{(values %$_)[0]} } @$cfg_set;
 
my $hp = HomePanel::Driver->new({
    template_file => ($config{template} || path(__FILE__)->parent->child('forecast.html.tt')),
    output_file => ($config{output_file} || path(__FILE__)->parent->child('forecast.html')),
    forecast_key => $config{forecast_key},
    forecast_latitude => $config{forecast_latitude},
    forecast_longitude => $config{forecast_longitude},
    bus_stop_ids => $config{bus_stop_id},
});
 
$hp->start;
$hp->loop->run;