Loading bin/efa-m +17 −5 Original line number Diff line number Diff line Loading @@ -65,16 +65,26 @@ if ( @ARGV < 1 or @ARGV > 2 ) { @grep_mots = split( qr{,}, join( q{,}, @grep_mots ) ); @grep_platforms = split( qr{,}, join( q{,}, @grep_platforms ) ); my ( $place, $input ); my ( $place, $input, $stopseq ); if ( @ARGV == 1 ) { if ( $ARGV[0] =~ m{ ^ ! ([^@]*) @ ([^@]*) [(] ([^)]*) [)] (.*) $ }x ) { $stopseq = { stateless => $1, stop_id => $2, date => $3, key => $4 }; } else { $input = $ARGV[0]; } } else { ( $place, $input ) = @ARGV; } if ( $input =~ s{ ^ (?<type> address|poi|stop|stopID) : }{}x ) { if ( $input and $input =~ s{ ^ (?<type> address|poi|stop|stopID) : }{}x ) { $input_type = $+{type}; } Loading Loading @@ -118,6 +128,7 @@ sub new_efa { full_routes => $full_routes, place => $place, name => $input, stopseq => $stopseq, time => $time, type => $input_type, timeout => $timeout, Loading Loading @@ -354,8 +365,9 @@ sub show_results { @output_line = ( $dtime, $platform, $line, q{}, $d->destination, $d ); if ($show_jid) { $output_line[2] .= sprintf( ' %s@%d@%d', $d->stateless, $d->stop_id, $d->key ); $output_line[2] .= sprintf( ' %s@%d(%s)%d', $d->stateless, $d->stop_id, $d->sched_datetime->strftime('%Y%m%d'), $d->key ); } if ( $edata{route} ) { Loading lib/Travel/Status/DE/EFA.pm +29 −16 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ sub new { delete $opt{timeout}; } if ( not( $opt{name} or $opt{from_json} ) ) { if ( not( $opt{name} or $opt{stopseq} or $opt{from_json} ) ) { confess('You must specify a name'); } if ( $opt{type} Loading @@ -156,7 +156,7 @@ sub new { if ( $opt{service} and exists $efa_instance{ $opt{service} } ) { $opt{efa_url} = $efa_instance{ $opt{service} }{url}; if ( $opt{journey} ) { if ( $opt{stopseq} ) { $opt{efa_url} .= '/XML_STOPSEQCOORD_REQUEST'; } else { Loading Loading @@ -211,20 +211,6 @@ sub new { } my $self = { post => { language => 'de', mode => 'direct', outputFormat => 'JSON', type_dm => $opt{type} // 'stop', useProxFootSearch => $opt{proximity_search} ? '1' : '0', useRealtime => '1', itdDateDay => $dt->day, itdDateMonth => $dt->month, itdDateYear => $dt->year, itdTimeHour => $dt->hour, itdTimeMinute => $dt->minute, name_dm => encode( 'UTF-8', $opt{name} ), }, response => $opt{from_json}, developer_mode => $opt{developer_mode}, efa_url => $opt{efa_url}, Loading @@ -241,6 +227,33 @@ sub new { json => JSON->new->utf8, }; if ( $opt{stopseq} ) { $self->{post} = { line => $opt{stopseq}{stateless}, stop => $opt{stopseq}{stop_id}, tripCode => $opt{stopseq}{key}, date => $opt{stopseq}{date}, coordOutputFormat => 'WGS84[DD.DDDDD]', outputFormat => 'rapidJson', }; } else { $self->{post} = { language => 'de', mode => 'direct', outputFormat => 'JSON', type_dm => $opt{type} // 'stop', useProxFootSearch => $opt{proximity_search} ? '1' : '0', useRealtime => '1', itdDateDay => $dt->day, itdDateMonth => $dt->month, itdDateYear => $dt->year, itdTimeHour => $dt->hour, itdTimeMinute => $dt->minute, name_dm => encode( 'UTF-8', $opt{name} ), }; } if ( $opt{place} ) { $self->{post}{placeInfo_dm} = 'invalid'; $self->{post}{placeState_dm} = 'empty'; Loading Loading
bin/efa-m +17 −5 Original line number Diff line number Diff line Loading @@ -65,16 +65,26 @@ if ( @ARGV < 1 or @ARGV > 2 ) { @grep_mots = split( qr{,}, join( q{,}, @grep_mots ) ); @grep_platforms = split( qr{,}, join( q{,}, @grep_platforms ) ); my ( $place, $input ); my ( $place, $input, $stopseq ); if ( @ARGV == 1 ) { if ( $ARGV[0] =~ m{ ^ ! ([^@]*) @ ([^@]*) [(] ([^)]*) [)] (.*) $ }x ) { $stopseq = { stateless => $1, stop_id => $2, date => $3, key => $4 }; } else { $input = $ARGV[0]; } } else { ( $place, $input ) = @ARGV; } if ( $input =~ s{ ^ (?<type> address|poi|stop|stopID) : }{}x ) { if ( $input and $input =~ s{ ^ (?<type> address|poi|stop|stopID) : }{}x ) { $input_type = $+{type}; } Loading Loading @@ -118,6 +128,7 @@ sub new_efa { full_routes => $full_routes, place => $place, name => $input, stopseq => $stopseq, time => $time, type => $input_type, timeout => $timeout, Loading Loading @@ -354,8 +365,9 @@ sub show_results { @output_line = ( $dtime, $platform, $line, q{}, $d->destination, $d ); if ($show_jid) { $output_line[2] .= sprintf( ' %s@%d@%d', $d->stateless, $d->stop_id, $d->key ); $output_line[2] .= sprintf( ' %s@%d(%s)%d', $d->stateless, $d->stop_id, $d->sched_datetime->strftime('%Y%m%d'), $d->key ); } if ( $edata{route} ) { Loading
lib/Travel/Status/DE/EFA.pm +29 −16 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ sub new { delete $opt{timeout}; } if ( not( $opt{name} or $opt{from_json} ) ) { if ( not( $opt{name} or $opt{stopseq} or $opt{from_json} ) ) { confess('You must specify a name'); } if ( $opt{type} Loading @@ -156,7 +156,7 @@ sub new { if ( $opt{service} and exists $efa_instance{ $opt{service} } ) { $opt{efa_url} = $efa_instance{ $opt{service} }{url}; if ( $opt{journey} ) { if ( $opt{stopseq} ) { $opt{efa_url} .= '/XML_STOPSEQCOORD_REQUEST'; } else { Loading Loading @@ -211,20 +211,6 @@ sub new { } my $self = { post => { language => 'de', mode => 'direct', outputFormat => 'JSON', type_dm => $opt{type} // 'stop', useProxFootSearch => $opt{proximity_search} ? '1' : '0', useRealtime => '1', itdDateDay => $dt->day, itdDateMonth => $dt->month, itdDateYear => $dt->year, itdTimeHour => $dt->hour, itdTimeMinute => $dt->minute, name_dm => encode( 'UTF-8', $opt{name} ), }, response => $opt{from_json}, developer_mode => $opt{developer_mode}, efa_url => $opt{efa_url}, Loading @@ -241,6 +227,33 @@ sub new { json => JSON->new->utf8, }; if ( $opt{stopseq} ) { $self->{post} = { line => $opt{stopseq}{stateless}, stop => $opt{stopseq}{stop_id}, tripCode => $opt{stopseq}{key}, date => $opt{stopseq}{date}, coordOutputFormat => 'WGS84[DD.DDDDD]', outputFormat => 'rapidJson', }; } else { $self->{post} = { language => 'de', mode => 'direct', outputFormat => 'JSON', type_dm => $opt{type} // 'stop', useProxFootSearch => $opt{proximity_search} ? '1' : '0', useRealtime => '1', itdDateDay => $dt->day, itdDateMonth => $dt->month, itdDateYear => $dt->year, itdTimeHour => $dt->hour, itdTimeMinute => $dt->minute, name_dm => encode( 'UTF-8', $opt{name} ), }; } if ( $opt{place} ) { $self->{post}{placeInfo_dm} = 'invalid'; $self->{post}{placeState_dm} = 'empty'; Loading