diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-01-03 15:10:39 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-01-03 15:10:39 +0100 |
commit | 7f73d668ac162af723bbc80b2bb35b7419715c5b (patch) | |
tree | 5221468cb8ef6da30a12e4fbc06e7a0fa1689852 /scripts/debug | |
parent | 99af8a8a7577b151e9fe6593a5241ac88773d48c (diff) |
add debug helper script
Diffstat (limited to 'scripts/debug')
-rwxr-xr-x | scripts/debug | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/debug b/scripts/debug new file mode 100755 index 0000000..bc02543 --- /dev/null +++ b/scripts/debug @@ -0,0 +1,35 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use 5.018; + +binmode( STDOUT, ':encoding(utf-8)' ); + +use Data::Dumper; +use Travel::Status::DE::DeutscheBahn; +use Travel::Status::DE::IRIS; + +my $ris = Travel::Status::DE::DeutscheBahn->new( + station => $ARGV[0], + mode => 'dep', +); + +my $iris = Travel::Status::DE::IRIS->new( + station => $ARGV[1], +); + +my @res_ris = $ris->results; +my @res_iris = $iris->results; + +for my $d (@res_iris) { + printf("\n\n %5s %10s %4s %20s (%s)\n", $d->time, $d->train, $d->platform, $d->route_end, join(q{ }, $d->route_interesting)); + my @matching = grep { $_->time . $_->train eq $d->time . $d->train } @res_ris; + for my $risd (@matching) { + printf(" -> %5s %10s %4s %20s (%s)\n", $risd->time, $risd->train, $risd->platform, $risd->route_end, join(q{ }, $risd->route_interesting)); + printf(" -> %s\n", $risd->info_raw); + } + if ($d->realtime_xml) { + print $d->realtime_xml->toString(1); + } +} |