Loading .gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -9,3 +9,4 @@ /META.json /MYMETA.yml /MYMETA.json /lib/Travel/Status/DE/EFA/Services.pm .gitmodules 0 → 100644 +3 −0 Original line number Diff line number Diff line [submodule "ext/transport-apis"] path = ext/transport-apis url = https://github.com/public-transport/transport-apis.git Changelog +4 −2 Original line number Diff line number Diff line Loading @@ -4,11 +4,13 @@ git HEAD * Switch API language from XML to JSON * Rename Travel::Status::DE::EFA::Result to Travel::Status::DE::EFA::Departure * EFA: Remove "identified_data" accessor (not supported by JSON backends) * Result/Departure: Remove "info" accessor * Result/Departure: Add "hints" accessor * Stop: Remove "name_suf" accessor * Result/Departure: Remove "info" accessor; use "hints" instead * Stop: Add "place", "full_name" and "occupancy" accessors * Stop: Remove "name_suf" accessor; use "name" instead * Line: Add "number" accessor * EFA: Remove "get_efa_urls" and "get_service" functions; use the newly introduced Travel::Status::DE::EFA::Services package instead. * efa-m: -Oa, -Ob, -Of: show per-stop occupancy, if available Travel::Status::DE::VRR 2.02 - Sun May 19 2024 Loading bin/efa-m +13 −7 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ use Encode qw(decode); use Getopt::Long qw(:config no_ignore_case bundling); use List::Util qw(first max none); use Travel::Status::DE::EFA; use Travel::Status::DE::EFA::Services; my $service = 'VRR'; my $efa_url; Loading Loading @@ -112,7 +113,7 @@ if ($efa_url) { $service = undef; } elsif ($service) { my $service_ref = Travel::Status::DE::EFA::get_service($service); my $service_ref = Travel::Status::DE::EFA::Services::get_service($service); if ( not $service_ref ) { printf STDERR ( "Error: Unknown service '%s'. See 'efa-m --list' for a " Loading Loading @@ -156,8 +157,11 @@ sub show_help { sub show_services { printf( "%-45s %-14s %s\n\n", 'service', 'abbr. (-s)', 'url (-u)' ); for my $service ( Travel::Status::DE::EFA::get_efa_urls() ) { printf( "%-45s %-14s %s\n", @{$service}{qw(name shortname url)} ); for my $shortname ( Travel::Status::DE::EFA::Services::get_service_ids() ) { my $service = Travel::Status::DE::EFA::Services::get_service($shortname); printf( "%-45s %-14s %s\n", $service->{name}, $shortname, $service->{url} ); } exit 0; Loading Loading @@ -437,16 +441,18 @@ sub show_results { } if ( $discover or $discover_and_print ) { for my $service_ref ( Travel::Status::DE::EFA::get_efa_urls() ) { $efa = new_efa( $service_ref->{shortname} ); for my $shortname ( Travel::Status::DE::EFA::Services::get_service_ids() ) { $efa = new_efa($shortname); if ( $efa and not $efa->errstr ) { if ($discover_and_print) { last; } my $service_ref = Travel::Status::DE::EFA::Services::get_service($shortname); printf( "%s / %s (%s)\n -> efa-m -s %s %s\n\n", @{$service_ref}{qw(name shortname url shortname)}, join( q{ }, map { "'$_'" } @ARGV ), $service_ref->{name}, $shortname, $service_ref->{url}, $shortname, join( q{ }, map { "'$_'" } @ARGV ), ); } } Loading transport-apis @ 16ded4b8 Original line number Diff line number Diff line Subproject commit 16ded4b86256cba98c19fc0967c54ad7554f77eb Loading
.gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -9,3 +9,4 @@ /META.json /MYMETA.yml /MYMETA.json /lib/Travel/Status/DE/EFA/Services.pm
.gitmodules 0 → 100644 +3 −0 Original line number Diff line number Diff line [submodule "ext/transport-apis"] path = ext/transport-apis url = https://github.com/public-transport/transport-apis.git
Changelog +4 −2 Original line number Diff line number Diff line Loading @@ -4,11 +4,13 @@ git HEAD * Switch API language from XML to JSON * Rename Travel::Status::DE::EFA::Result to Travel::Status::DE::EFA::Departure * EFA: Remove "identified_data" accessor (not supported by JSON backends) * Result/Departure: Remove "info" accessor * Result/Departure: Add "hints" accessor * Stop: Remove "name_suf" accessor * Result/Departure: Remove "info" accessor; use "hints" instead * Stop: Add "place", "full_name" and "occupancy" accessors * Stop: Remove "name_suf" accessor; use "name" instead * Line: Add "number" accessor * EFA: Remove "get_efa_urls" and "get_service" functions; use the newly introduced Travel::Status::DE::EFA::Services package instead. * efa-m: -Oa, -Ob, -Of: show per-stop occupancy, if available Travel::Status::DE::VRR 2.02 - Sun May 19 2024 Loading
bin/efa-m +13 −7 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ use Encode qw(decode); use Getopt::Long qw(:config no_ignore_case bundling); use List::Util qw(first max none); use Travel::Status::DE::EFA; use Travel::Status::DE::EFA::Services; my $service = 'VRR'; my $efa_url; Loading Loading @@ -112,7 +113,7 @@ if ($efa_url) { $service = undef; } elsif ($service) { my $service_ref = Travel::Status::DE::EFA::get_service($service); my $service_ref = Travel::Status::DE::EFA::Services::get_service($service); if ( not $service_ref ) { printf STDERR ( "Error: Unknown service '%s'. See 'efa-m --list' for a " Loading Loading @@ -156,8 +157,11 @@ sub show_help { sub show_services { printf( "%-45s %-14s %s\n\n", 'service', 'abbr. (-s)', 'url (-u)' ); for my $service ( Travel::Status::DE::EFA::get_efa_urls() ) { printf( "%-45s %-14s %s\n", @{$service}{qw(name shortname url)} ); for my $shortname ( Travel::Status::DE::EFA::Services::get_service_ids() ) { my $service = Travel::Status::DE::EFA::Services::get_service($shortname); printf( "%-45s %-14s %s\n", $service->{name}, $shortname, $service->{url} ); } exit 0; Loading Loading @@ -437,16 +441,18 @@ sub show_results { } if ( $discover or $discover_and_print ) { for my $service_ref ( Travel::Status::DE::EFA::get_efa_urls() ) { $efa = new_efa( $service_ref->{shortname} ); for my $shortname ( Travel::Status::DE::EFA::Services::get_service_ids() ) { $efa = new_efa($shortname); if ( $efa and not $efa->errstr ) { if ($discover_and_print) { last; } my $service_ref = Travel::Status::DE::EFA::Services::get_service($shortname); printf( "%s / %s (%s)\n -> efa-m -s %s %s\n\n", @{$service_ref}{qw(name shortname url shortname)}, join( q{ }, map { "'$_'" } @ARGV ), $service_ref->{name}, $shortname, $service_ref->{url}, $shortname, join( q{ }, map { "'$_'" } @ARGV ), ); } } Loading
transport-apis @ 16ded4b8 Original line number Diff line number Diff line Subproject commit 16ded4b86256cba98c19fc0967c54ad7554f77eb