diff options
-rw-r--r-- | .github/workflows/perl.yml | 2 | ||||
-rw-r--r-- | Changelog | 7 | ||||
-rw-r--r-- | README.md | 16 | ||||
-rwxr-xr-x | bin/db-iris | 18 | ||||
-rw-r--r-- | lib/Travel/Status/DE/IRIS.pm | 20 | ||||
-rw-r--r-- | lib/Travel/Status/DE/IRIS/Result.pm | 5 | ||||
-rw-r--r-- | lib/Travel/Status/DE/IRIS/Stations.pm.PL | 4 | ||||
-rwxr-xr-x | share/enhance | 12 | ||||
-rw-r--r-- | share/renamed.json | 1 | ||||
-rw-r--r-- | share/stations.json | 9 |
10 files changed, 45 insertions, 49 deletions
diff --git a/.github/workflows/perl.yml b/.github/workflows/perl.yml index 4079d50..9c5dbb0 100644 --- a/.github/workflows/perl.yml +++ b/.github/workflows/perl.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: perl-version: - - '5.20' + - '5.30' - 'latest' - 'threaded' @@ -1,3 +1,10 @@ +Travel::Status::DE::IRIS 1.99 - Sat Jul 05 2025 + + * Deprecation notice: Mention Travel::Status::DE::DBRIS as recommended + successor. Travel::Status::DE::HAFAS is no longer a viable alternative. + * db-iris: Do not fail if Cache::File is unavailable + * Add delay code 27 (Technische Störung am Bus) + Travel::Status::DE::IRIS 1.98 - Thu Jul 04 2024 * Update stations list @@ -10,14 +10,14 @@ train stations via text and JSON output. ## DEPRECATION NOTICE As of May 2024, the backend service that this utility relies on is deprecated -and may cease operation in the near future. There is no immediate successor. -Hence, db-iris and Travel::Status::DE::IRIS are no longer actively maintained. -There is no promise that issues and merge requests will be reviewed or merged. - -The **hafas-m** application that is part of [Travel::Status::DE::HAFAS](https://finalrewind.org/projects/Travel-Status-DE-DeutscheBahn/) -provides similar features. However, its default "DB" backend is also -deprecated. There is no migration path to a Deutsche Bahn departure monitor -that is not deprecated at the moment. +and may cease operation in the near future. Hence, db-iris and +Travel::Status::DE::IRIS are no longer actively maintained. There is no +promise that issues and merge requests will be reviewed or merged. + +The **dbris-m** application that is part of +[Travel::Status::DE::DBRIS](https://finalrewind.org/projects/Travel-Status-DE-DBRIS/) +has similar features. Note that its backend does not provide detailed +(timestamped) delay and quality of service messages. ## Installation diff --git a/bin/db-iris b/bin/db-iris index 8edce72..53e094f 100755 --- a/bin/db-iris +++ b/bin/db-iris @@ -4,7 +4,7 @@ use warnings; use 5.014; use utf8; -our $VERSION = '1.98'; +our $VERSION = '1.99'; use DateTime; use DateTime::Format::Strptime; @@ -78,7 +78,7 @@ if ($date) { if ( $date eq 'tomorrow' ) { $datetime->add( days => 1 ); } - elsif (not( defined $day and defined $month ) + elsif ( not( defined $day and defined $month ) or ( $day < 1 ) or ( $day > 31 ) or ( $month < 1 ) @@ -138,7 +138,7 @@ if ($use_cache) { my $schedule_cache_path = "${cache_path}/db-iris-schedule"; my $realtime_cache_path = "${cache_path}/db-iris-realtime"; eval { - use Cache::File; + require Cache::File; $schedule_cache = Cache::File->new( cache_root => $schedule_cache_path, default_expires => '6 hours', @@ -284,10 +284,10 @@ sub format_delay { $delay = ( $d->delay > 0 ? ' +' : q{ } ) . $d->delay; } if ( $d->is_cancelled ) { - $delay = ' CANCELED'; + $delay = ' XXX'; } elsif ( $d->departure_is_cancelled ) { - $delay .= ' ⊖'; + $delay .= ' xxx'; } elsif ( $d->start < $datetime and not $d->has_realtime ) { $delay = ' ?'; @@ -587,7 +587,7 @@ B<db-iris> [B<-rx>] [B<-d> I<date>] [B<-o> I<output-flags>] =head1 VERSION -version 1.98 +version 1.99 =head1 DEPRECATION NOTICE @@ -596,10 +596,8 @@ and may cease operation in the near future. There is no immediate successor. Hence, db-iris and Travel::Status::DE::IRIS are no longer actively maintained. There is no promise that issues and merge requests will be reviewed or merged. -The B<hafas-m> application that is part of Travel::Status::DE::HAFAS(3pm) -provides similar features. However, its default "DB" backend is also -deprecated. There is no migration path to a Deutsche Bahn departure monitor -that is not deprecated at the moment. +The B<dbris-m> application that is part of Travel::Status::DE::DBRIS(3pm) +provides similar features. =head1 DESCRIPTION diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm index 6643814..a5473f7 100644 --- a/lib/Travel/Status/DE/IRIS.pm +++ b/lib/Travel/Status/DE/IRIS.pm @@ -4,7 +4,7 @@ use strict; use warnings; use 5.014; -our $VERSION = '1.98'; +our $VERSION = '1.99'; use Carp qw(confess cluck); use DateTime; @@ -448,13 +448,13 @@ sub get_station_p { ); return; } - )->catch( + )->catch( sub { my ($err) = @_; $promise->reject($err); return; } - )->wait; + )->wait; return $promise; } @@ -672,13 +672,13 @@ sub get_timetable_p { $promise->resolve; return; } - )->catch( + )->catch( sub { my ($err) = @_; $promise->reject($err); return; } - )->wait; + )->wait; return $promise; } @@ -736,13 +736,13 @@ sub get_realtime_p { $promise->resolve; return; } - )->catch( + )->catch( sub { my ($err) = @_; $promise->reject("Failed to fetch realtime data: $err"); return; } - )->wait; + )->wait; return $promise; } @@ -996,7 +996,7 @@ Non-blocking variant (EXPERIMENTAL): =head1 VERSION -version 1.98 +version 1.99 =head1 DEPRECATION NOTICE @@ -1005,9 +1005,7 @@ and may cease operation in the near future. There is no immediate successor. Hence, Travel::Status::DE::IRIS is no longer actively maintained. There is no promise that issues and merge requests will be reviewed or merged. -The Travel::Status::DE::HAFAS(3pm) module provides similar features. However, -its default "DB" backend is also deprecated. There is no migration path to a -Deutsche Bahn departure monitor that is not deprecated at the moment. +The Travel::Status::DE::DBRIS(3pm) module provides similar features. =head1 DESCRIPTION diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm index 7523bc4..77f65fa 100644 --- a/lib/Travel/Status/DE/IRIS/Result.pm +++ b/lib/Travel/Status/DE/IRIS/Result.pm @@ -14,7 +14,7 @@ use List::Util qw(any); use List::MoreUtils qw(uniq lastval); use Scalar::Util qw(weaken); -our $VERSION = '1.98'; +our $VERSION = '1.99'; Travel::Status::DE::IRIS::Result->mk_ro_accessors( qw(arrival arrival_delay arrival_has_realtime arrival_is_additional arrival_is_cancelled arrival_hidden @@ -59,6 +59,7 @@ my %translation = ( 24 => 'Verspätung im Ausland', 25 => 'Bereitstellung weiterer Wagen', 26 => 'Abhängen von Wagen', + 27 => 'Technische Störung am Bus', 28 => 'Gegenstände auf der Strecke', 29 => 'Ersatzverkehr mit Bus ist eingerichtet', 31 => 'Bauarbeiten', @@ -939,7 +940,7 @@ arrival/departure received by Travel::Status::DE::IRIS =head1 VERSION -version 1.98 +version 1.99 =head1 DESCRIPTION diff --git a/lib/Travel/Status/DE/IRIS/Stations.pm.PL b/lib/Travel/Status/DE/IRIS/Stations.pm.PL index f2b777c..b38c98e 100644 --- a/lib/Travel/Status/DE/IRIS/Stations.pm.PL +++ b/lib/Travel/Status/DE/IRIS/Stations.pm.PL @@ -34,7 +34,7 @@ use Text::LevenshteinXS qw(distance); # TODO switch to Text::Levenshtein::XS once AUR/Debian packages become available -our $VERSION = '1.98'; +our $VERSION = '1.99'; # Automatically generated, see share/stations.json my @stations = ( @@ -204,7 +204,7 @@ Travel::Status::DE::IRIS::Stations - Station name to station code mapping =head1 VERSION -version 1.98 +version 1.99 =head1 DESCRIPTION diff --git a/share/enhance b/share/enhance index 25533c6..545ac65 100755 --- a/share/enhance +++ b/share/enhance @@ -20,16 +20,16 @@ for my $station ( @{$stations} ) { my $hafas = Travel::Status::DE::HAFAS->new( locationSearch => $station->{name}, ); - if (not scalar $hafas->results) { + if ( not scalar $hafas->results ) { say ' not found'; next; } - my $result = ($hafas->results)[0]; - if ($result->name ne $station->{name}) { - say ' name mismatch: got ' . $result->name; - next; + for my $result ( $hafas->results ) { + if ( $result->name eq $station->{name} ) { + $station->{latlong} = [ $result->lat, $result->lon ]; + last; + } } - $station->{latlong} = [ $result->lat, $result->lon ]; } } diff --git a/share/renamed.json b/share/renamed.json index 51cd500..1e9a96a 100644 --- a/share/renamed.json +++ b/share/renamed.json @@ -128,6 +128,7 @@ "Urmitz" : "Mülheim-Kärlich", "Valence TGV" : "Valence TGV Rhône-Alpes Sud", "Velesyn mesto" : "Velesin mesto", + "Villiers-le-Bel-Gonesse" : "Villiers-le-Bel-Gonesse-Arnouville", "Vogelsang(Gransee)" : "Vogelsang(Kr Oberhavel)", "Volkswohnung/Staatstheater, Karlsruhe" : "Kongresszentrum, Karlsruhe", "Waggonfabrik" : "Mainz Waggonfabrik", diff --git a/share/stations.json b/share/stations.json index 2acb343..b54e086 100644 --- a/share/stations.json +++ b/share/stations.json @@ -63000,15 +63000,6 @@ "name" : "Pfäffingen" }, { - "ds100" : "PQKPC", - "eva" : 378621, - "latlong" : [ - 49.004594, - 8.411851 - ], - "name" : "Philipp-Reis-Straße, Karlsruhe" - }, - { "ds100" : "PQKPS", "eva" : 721660, "latlong" : [ |