From 7a24a7d8168639e8e6a6c0f17429681dbdc2aed7 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 1 Nov 2015 22:29:05 +0100 Subject: support UIC codes --- Changelog | 1 + bin/db-iris | 4 ++++ lib/Travel/Status/DE/IRIS.pm | 1 + 3 files changed, 6 insertions(+) diff --git a/Changelog b/Changelog index 4d4c20c..6110b96 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ git HEAD * Result: Add qos code 79 ("Ohne Mehrzweckabteil") + * db-iris: Accept UIC station codes Travel::Status::DE::IRIS 1.03 - Tue Sep 15 2015 diff --git a/bin/db-iris b/bin/db-iris index 2aa94b7..ecbf376 100755 --- a/bin/db-iris +++ b/bin/db-iris @@ -141,6 +141,10 @@ sub get_departure { sub get_station { my ($input_name) = @_; + if ( $input_name =~ m{ ^ [[:digit:]]+ $ }x ) { + return $input_name; + } + my @stations = Travel::Status::DE::IRIS::Stations::get_station($input_name); if ( @stations == 0 ) { diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm index 984c209..f9300f0 100644 --- a/lib/Travel/Status/DE/IRIS.pm +++ b/lib/Travel/Status/DE/IRIS.pm @@ -67,6 +67,7 @@ sub new { $self->{station} = $opt{station}; $self->{station_code} = $station_node->getAttribute('eva'); + $self->{station_name} = $station_node->getAttribute('name'); my $dt_req = $self->{datetime}->clone; for ( 1 .. 3 ) { -- cgit v1.2.3