summaryrefslogtreecommitdiff
path: root/driver.pl
blob: df8e1fa65aca808cde2b9c51844402768fe1c046 (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
29
30
31
32
33
#!/usr/bin/env perl 
use strict;
use warnings;
use 5.014;
use WebService::ForecastIo::Response;
use WebService::TFL::Bus;
use WebService::TFL::Bus::Request;
use WebService::TFL::TubeStatus;
use HomePanel::Render;
use Path::Class;
 
my $forecast = WebService::ForecastIo::Response->new(
    file($ARGV[0])->slurp(iomode=>'<:raw')
);
my $bus = WebService::TFL::Bus->new()->request(
    WebService::TFL::Bus::Request->new({
        StopPointName => 'Hotspur Road',
        #Towards => 'Islip Manor', 
        ReturnList => [qw(StopID StopCode1 VisitNumber TripID VehicleID LineID LineName DirectionID DestinationText DestinationName EstimatedTime)],
    }),
);
my $tube = WebService::TFL::TubeStatus->new()->request();
my $template = file(__FILE__)->parent->file('forecast.html.tt');
 
binmode STDOUT,':utf8';
 
print
    HomePanel::Render->new({
        template_file => $template,
        forecast => $forecast,
        bus => $bus,
        tube => $tube,
    })->render;