EFA.pm

filter: Statementstmt 79.2% 306 / 386 Branchbran 72.3% 81 / 112 Conditioncond 55.9% 33 / 59 MC/DCmcdc 28.1% 9 / 32 Subroutinesub 73.8% 31 / 42 Podpod 61.2% 19 / 31 totaltotal 72.3% 479 / 662 CC 86 SCAR 23.5
CC
86
Cov
75%
create_post
20.1
submit
20.0
parse_xml_part
19.5
CRAP 10.5
↑ Summary EFA/Route/Part.pm »
1 package Travel::Routing::DE::EFA;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Carp qw(cluck);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Encode qw(encode);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Travel::Routing::DE::EFA::Route;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Travel::Routing::DE::EFA::Route::Message;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use LWP::UserAgent;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use XML::LibXML;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶use Exception::Class (
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 'Travel::Routing::DE::EFA::Exception',
17 'Travel::Routing::DE::EFA::Exception::Setup' => {
18 isa => 'Travel::Routing::DE::EFA::Exception',
19 description => 'invalid argument on setup',
20 fields => [ 'option', 'have', 'want' ],
21 },
22 'Travel::Routing::DE::EFA::Exception::Net' => {
23 isa => 'Travel::Routing::DE::EFA::Exception',
24 description => 'could not submit POST request',
25 fields => 'http_response',
26 },
27 'Travel::Routing::DE::EFA::Exception::NoData' => {
28 isa => 'Travel::Routing::DE::EFA::Exception',
29 description => 'backend returned no parsable route',
30 },
31 'Travel::Routing::DE::EFA::Exception::Ambiguous' => {
32 isa => 'Travel::Routing::DE::EFA::Exception',
33 description => 'ambiguous input',
34 fields => [ 'post_key', 'post_value', 'possibilities' ],
35 },
36 'Travel::Routing::DE::EFA::Exception::Other' => {
37 isa => 'Travel::Routing::DE::EFA::Exception',
38 description => 'EFA backend returned an error',
39 fields => ['message'],
40 },
41 2 );
42  
43 2 our $VERSION = '2.25';
44  
45 4 ▶sub set_time {
Subroutine set_time: called CC=4 SCAR=13.9
Pod undocumented
46 4 my ( $self, %conf ) = @_;
47  
48 4 my $time;
49  
50 4 ▶ if ( $conf{departure_time} ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($conf{'departure_time'}) { } 3 1 4
elsif ($conf{'arrival_time'}) { } 1 0 1
51 3 $self->{post}->{itdTripDateTimeDepArr} = 'dep';
52 3 $time = $conf{departure_time};
53 }
54 elsif ( $conf{arrival_time} ) {
55 1 $self->{post}->{itdTripDateTimeDepArr} = 'arr';
56 1 $time = $conf{arrival_time};
57 }
58 else {
59 0 Travel::Routing::DE::EFA::Exception::Setup->throw(
60 option => 'time',
61 error => 'Specify either departure_time or arrival_time'
62 );
63 }
64  
65 4 ▶ if ( $time =~ m{ ^ ([0-2]? \d) :? ([0-5] \d) $ }x ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($time =~ / ^ ([0-2]? \d) :? ([0-5] \d) $ /x) { } 2 2 4
66 2 @{ $self->{post} }{ 'itdTimeHour', 'itdTimeMinute' } = ( $1, $2 );
67 }
68 else {
69 2 Travel::Routing::DE::EFA::Exception::Setup->throw(
70 option => 'time',
71 have => $time,
72 want => 'HH:MM',
73 );
74 }
75  
76 2 return;
77 }
78  
79 0 ▶sub departure_time {
Subroutine departure_time: not called CC=1 SCAR=6.9
Pod documented
80 0 my ( $self, $time ) = @_;
81  
82 0 return $self->set_time( departure_time => $time );
83 }
84  
85 0 ▶sub arrival_time {
Subroutine arrival_time: not called CC=1 SCAR=6.9
Pod documented
86 0 my ( $self, $time ) = @_;
87  
88 0 return $self->set_time( arrival_time => $time );
89 }
90  
91 4 ▶sub date {
Subroutine date: called CC=12 SCAR=27.7
Pod documented
92 4 my ( $self, $date ) = @_;
93  
94 4 my ( $day, $month, $year ) = split( /[.]/, $date );
95  
96 4 ▶ if ( $date eq 'tomorrow' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($date eq "tomorrow") 0 4 4
97 0 ( undef, undef, undef, $day, $month, $year )
98 = localtime( time + 86400 );
99 0 $month += 1;
100 0 $year += 1900;
101 }
102  
103 4 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $day and length $day and $day >= 1 and $day <= 31 and defined $month and length $month and $month >= 1 and $month <= 12) 2 2 4
Condition61%13/21
defined $day and length $day and $day >= 1 and $day <= 31 and defined $month and length $month and $month >= 1 and $month <= 12
!ll&&!rl&&r
202
defined $day and length $day and $day >= 1 and $day <= 31 and defined $month and length $month and $month >= 1
!ll&&!rl&&r
202
defined $day and length $day and $day >= 1 and $day <= 31 and defined $month and length $month
!ll&&!rl&&r
112
defined $day and length $day and $day >= 1 and $day <= 31 and defined $month
!ll&&!rl&&r
103
defined $day and length $day and $day >= 1 and $day <= 31
!ll&&!rl&&r
013
defined $day and length $day and $day >= 1
!ll&&!rl&&r
004
defined $day and length $day
!ll&&!rl&&r
004
MC/DC25%2/8
defined $day and length $day and $day >= 1 and $day <= 31 and defined $month and length $month and $month >= 1 and $month <= 12
defined $day length $day $day >= 1 $day <= 31 defined $month length $month $month >= 1 $month <= 12
Truth table33%3/9
A and B and C and D and E and F and G and H
A= defined $dayB= length $dayC= $day >= 1D= $day <= 31E= defined $monthF= length $monthG= $month >= 1H= $month <= 12
ABCDEFGHresult
0XXXXXXX0
10XXXXXX0
110XXXXX0
1110XXXX0
11110XXX0
111110XX0
1111110X0
111111100
111111111
104 not( defined $day
105 and length($day)
106 and $day >= 1
107 and $day <= 31
108 and defined $month
109 and length($month)
110 and $month >= 1
111 and $month <= 12 )
112 )
113 {
114 2 Travel::Routing::DE::EFA::Exception::Setup->throw(
115 option => 'date',
116 have => $date,
117 want => 'DD.MM[.[YYYY]]'
118 );
119 }
120  
121 2 ▶ if ( not defined $year or not length($year) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $year and length $year) 1 1 2
Condition66%2/3
defined $year and length $year
!ll&&!rl&&r
011
MC/DC50%1/2
defined $year and length $year
defined $year length $year
Truth table66%2/3
A and B
A= defined $yearB= length $year
ABresult
0X0
100
111
122 1 $year = ( localtime(time) )[5] + 1900;
123 }
124  
125 2 @{ $self->{post} }{ 'itdDateDay', 'itdDateMonth', 'itdDateYear' }
126 = ( $day, $month, $year );
127  
128 2 return;
129 }
130  
131 3 ▶sub exclude {
Subroutine exclude: called CC=5 SCAR=16.1
Pod documented
132 3 my ( $self, @exclude ) = @_;
133  
134 3 my @mapping = qw{
135 zug s-bahn u-bahn stadtbahn tram stadtbus regionalbus
136 schnellbus seilbahn schiff ast sonstige
137 };
138  
139 3 foreach my $exclude_type (@exclude) {
140 6 my $ok = 0;
141 6 for my $map_id ( 0 .. $#mapping ) {
142 72 ▶ if ( $exclude_type eq $mapping[$map_id] ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($exclude_type eq $mapping[$map_id]) 5 67 72
143 5 delete $self->{post}->{"inclMOT_${map_id}"};
144 5 $ok = 1;
145 }
146 }
147 6 ▶ if ( not $ok ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($ok) 1 5 6
148 1 Travel::Routing::DE::EFA::Exception::Setup->throw(
149 option => 'exclude',
150 have => $exclude_type,
151 want => join( ' / ', @mapping ),
152 );
153 }
154 }
155  
156 2 return;
157 }
158  
159 1 ▶sub max_interchanges {
Subroutine max_interchanges: called CC=1 SCAR=0.0
Pod documented
160 1 my ( $self, $max ) = @_;
161  
162 1 $self->{post}->{maxChanges} = $max;
163  
164 1 return;
165 }
166  
167 0 ▶sub number_of_trips {
Subroutine number_of_trips: not called CC=1 SCAR=6.9
Pod undocumented
168 0 my ( $self, $num ) = @_;
169  
170 0 $self->{post}->{calcNumberOfTrips} = $num;
171  
172 0 return;
173 }
174  
175 4 ▶sub select_interchange_by {
Subroutine select_interchange_by: called CC=4 SCAR=13.9
Pod documented
176 4 my ( $self, $prefer ) = @_;
177  
178 4 ▶ if ( $prefer eq 'speed' ) { $self->{post}->{routeType} = 'LEASTTIME' }
Branch: 3 branches
BranchTrueFalseTotal
if ($prefer eq 'speed') { } 1 3 4
elsif ($prefer eq 'waittime') { } 1 2 3
elsif ($prefer eq 'distance') { } 1 1 2
179 elsif ( $prefer eq 'waittime' ) {
180 1 $self->{post}->{routeType} = 'LEASTINTERCHANGE';
181 }
182 elsif ( $prefer eq 'distance' ) {
183 1 $self->{post}->{routeType} = 'LEASTWALKING';
184 }
185 else {
186 1 Travel::Routing::DE::EFA::Exception::Setup->throw(
187 option => 'select_interchange_by',
188 have => $prefer,
189 want => 'speed / waittime / distance',
190 );
191 }
192  
193 3 return;
194 }
195  
196 4 ▶sub train_type {
Subroutine train_type: called CC=4 SCAR=13.9
Pod documented
197 4 my ( $self, $include ) = @_;
198  
199 4 ▶ if ( $include eq 'local' ) { $self->{post}->{lineRestriction} = 403 }
Branch: 3 branches
BranchTrueFalseTotal
if ($include eq 'local') { } 1 3 4
elsif ($include eq 'ic') { } 1 2 3
elsif ($include eq 'ice') { } 1 1 2
200 1 elsif ( $include eq 'ic' ) { $self->{post}->{lineRestriction} = 401 }
201 1 elsif ( $include eq 'ice' ) { $self->{post}->{lineRestriction} = 400 }
202 else {
203 1 Travel::Routing::DE::EFA::Exception::Setup->throw(
204 option => 'train_type',
205 have => $include,
206 want => 'local / ic / ice',
207 );
208 }
209  
210 3 return;
211 }
212  
213 1 ▶sub use_near_stops {
Subroutine use_near_stops: called CC=2 SCAR=7.1
Pod documented
214 1 my ( $self, $duration ) = @_;
215  
216 1 ▶ if ($duration) {
Branch: 1 branch
BranchTrueFalseTotal
if ($duration) { } 1 0 1
217 1 $self->{post}->{useProxFootSearch} = 1;
218 1 $self->{post}->{trITArrMOTvalue100} = $duration;
219 1 $self->{post}->{trITDepMOTvalue100} = $duration;
220 }
221 else {
222 0 $self->{post}->{useProxFootSearch} = 0;
223 }
224  
225 1 return;
226 }
227  
228 2 ▶sub walk_speed {
Subroutine walk_speed: called CC=2 SCAR=6.9
Pod documented
229 2 my ( $self, $walk_speed ) = @_;
230  
231 2 ▶ if ( $walk_speed =~ m{ ^ (?: normal | fast | slow ) $ }x ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($walk_speed =~ / ^ (?: normal | fast | slow ) $ /x) { } 1 1 2
232 1 $self->{post}->{changeSpeed} = $walk_speed;
233 }
234 else {
235 1 Travel::Routing::DE::EFA::Exception::Setup->throw(
236 option => 'walk_speed',
237 have => $walk_speed,
238 want => 'normal / fast / slow',
239 );
240 }
241  
242 1 return;
243 }
244  
245 1 ▶sub with_bike {
Subroutine with_bike: called CC=1 SCAR=0.0
Pod documented
246 1 my ( $self, $bike ) = @_;
247  
248 1 $self->{post}->{bikeTakeAlong} = $bike;
249  
250 1 return;
251 }
252  
253 0 ▶sub without_solid_stairs {
Subroutine without_solid_stairs: not called CC=1 SCAR=6.9
Pod documented
254 0 my ( $self, $opt ) = @_;
255  
256 0 $self->{post}->{noSolidStairs} = $opt;
257  
258 0 return;
259 }
260  
261 0 ▶sub without_escalators {
Subroutine without_escalators: not called CC=1 SCAR=6.9
Pod documented
262 0 my ( $self, $opt ) = @_;
263  
264 0 $self->{post}->{noEscalators} = $opt;
265  
266 0 return;
267 }
268  
269 0 ▶sub without_elevators {
Subroutine without_elevators: not called CC=1 SCAR=6.9
Pod documented
270 0 my ( $self, $opt ) = @_;
271  
272 0 $self->{post}->{noElevators} = $opt;
273  
274 0 return;
275 }
276  
277 0 ▶sub with_low_platform {
Subroutine with_low_platform: not called CC=1 SCAR=6.9
Pod documented
278 0 my ( $self, $opt ) = @_;
279  
280 0 $self->{post}->{lowPlatformVhcl} = $opt;
281  
282 0 return;
283 }
284  
285 0 ▶sub with_wheelchair {
Subroutine with_wheelchair: not called CC=1 SCAR=6.9
Pod documented
286 0 my ( $self, $opt ) = @_;
287  
288 0 $self->{post}->{wheelchair} = $opt;
289  
290 0 return;
291 }
292  
293 55 ▶sub place {
Subroutine place: called CC=5 SCAR=17.0
Pod undocumented
294 55 my ( $self, $which, $place, $stop, $type ) = @_;
295  
296 55 ▶ if ( not $stop ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($stop) 0 55 55
297 0 Travel::Routing::DE::EFA::Exception::Setup->throw(
298 option => 'place',
299 error => 'stop must be defined'
300 );
301 }
302  
303 55 ▶ $type //= 'stop';
Condition100%2/2
$type //= "stop"
l!l
154
MC/DC100%1/1
$type //= "stop"
$type
Truth table100%2/2
A
A= $type
Aresult
11
00
304  
305 55 ▶ if ($place) {
Branch: 1 branch
BranchTrueFalseTotal
if ($place) { } 55 0 55
306 55 @{ $self->{post} }{ "place_${which}", "name_${which}" }
307 = ( $place, $stop );
308 }
309 else {
310 0 $self->{post}{"name_${which}"} = $stop;
311 }
312  
313 55 ▶ if ( $type =~ m{ ^ (?: address | poi | stop ) $ }x ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type =~ / ^ (?: address | poi | stop ) $ /x) 55 0 55
314 55 $self->{post}->{"type_${which}"} = $type;
315 }
316  
317 55 return;
318 }
319  
320 27 ▶sub create_post {
Subroutine create_post: called CC=19 SCAR=30.0
Pod undocumented
321 27 my ($self) = @_;
322  
323 27 my $conf = $self->{config};
324 27 my @now = localtime( time() );
325  
326 $self->{post} = {
327 27 changeSpeed => 'normal',
328 command => q{},
329 execInst => q{},
330 imparedOptionsActive => 1,
331 inclMOT_0 => 'on',
332 inclMOT_1 => 'on',
333 inclMOT_10 => 'on',
334 inclMOT_11 => 'on',
335 inclMOT_2 => 'on',
336 inclMOT_3 => 'on',
337 inclMOT_4 => 'on',
338 inclMOT_5 => 'on',
339 inclMOT_6 => 'on',
340 inclMOT_7 => 'on',
341 inclMOT_8 => 'on',
342 inclMOT_9 => 'on',
343 includedMeans => 'checkbox',
344 itOptionsActive => 1,
345 itdDateDay => $now[3],
346 itdDateMonth => $now[4] + 1,
347 itdDateYear => $now[5] + 1900,
348 itdTimeHour => $now[2],
349 itdTimeMinute => $now[1],
350 itdTripDateTimeDepArr => 'dep',
351 language => 'de',
352 lineRestriction => 403,
353 maxChanges => 9,
354 nameInfo_destination => 'invalid',
355 nameInfo_origin => 'invalid',
356 nameInfo_via => 'invalid',
357 nameState_destination => 'empty',
358 nameState_origin => 'empty',
359 nameState_via => 'empty',
360 name_destination => q{},
361 name_origin => q{},
362 name_via => q{},
363 nextDepsPerLeg => 1,
364 outputFormat => 'XML',
365 placeInfo_destination => 'invalid',
366 placeInfo_origin => 'invalid',
367 placeInfo_via => 'invalid',
368 placeState_destination => 'empty',
369 placeState_origin => 'empty',
370 placeState_via => 'empty',
371 place_destination => q{},
372 place_origin => q{},
373 place_via => q{},
374 ptOptionsActive => 1,
375 requestID => 0,
376 routeType => 'LEASTTIME',
377 sessionID => 0,
378 text => 1993,
379 trITArrMOT => 100,
380 trITArrMOTvalue100 => 10,
381 trITArrMOTvalue101 => 10,
382 trITArrMOTvalue104 => 10,
383 trITArrMOTvalue105 => 10,
384 trITDepMOT => 100,
385 trITDepMOTvalue100 => 10,
386 trITDepMOTvalue101 => 10,
387 trITDepMOTvalue104 => 10,
388 trITDepMOTvalue105 => 10,
389 typeInfo_destination => 'invalid',
390 typeInfo_origin => 'invalid',
391 typeInfo_via => 'invalid',
392 type_destination => 'stop',
393 type_origin => 'stop',
394 type_via => 'stop',
395 useRealtime => 1
396 };
397  
398 27 $self->place( 'origin', @{ $conf->{origin} } );
399 27 $self->place( 'destination', @{ $conf->{destination} } );
400  
401 27 ▶ if ( $conf->{via} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"via"}) 1 26 27
402 1 $self->place( 'via', @{ $conf->{via} } );
403 }
404 27 ▶ if ( $conf->{arrival_time} || $conf->{departure_time} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"arrival_time"} or $conf->{"departure_time"}) 4 23 27
Condition100%3/3
$conf->{"arrival_time"} or $conf->{"departure_time"}
l!l&&r!l&&!r
1323
MC/DC100%2/2
$conf->{"arrival_time"} or $conf->{"departure_time"}
$conf->{"arrival_time"} $conf->{"departure_time"}
Truth table100%3/3
A or B
A= $conf->{"arrival_time"}B= $conf->{"departure_time"}
ABresult
1X1
011
000
405 4 $self->set_time( %{$conf} );
406 }
407 25 ▶ if ( $conf->{date} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"date"}) 4 21 25
408 4 $self->date( $conf->{date} );
409 }
410 23 ▶ if ( $conf->{exclude} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"exclude"}) 3 20 23
411 3 $self->exclude( @{ $conf->{exclude} } );
412 }
413 22 ▶ if ( $conf->{max_interchanges} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"max_interchanges"}) 1 21 22
414 1 $self->max_interchanges( $conf->{max_interchanges} );
415 }
416 22 ▶ if ( $conf->{num_results} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"num_results"}) 0 22 22
417 0 $self->number_of_trips( $conf->{num_results} );
418 }
419 22 ▶ if ( $conf->{select_interchange_by} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"select_interchange_by"}) 4 18 22
420 4 $self->select_interchange_by( $conf->{select_interchange_by} );
421 }
422 21 ▶ if ( $conf->{use_near_stops} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"use_near_stops"}) 1 20 21
423 1 $self->use_near_stops( $conf->{use_near_stops} );
424 }
425 21 ▶ if ( $conf->{train_type} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"train_type"}) 4 17 21
426 4 $self->train_type( $conf->{train_type} );
427 }
428 20 ▶ if ( $conf->{walk_speed} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"walk_speed"}) 2 18 20
429 2 $self->walk_speed( $conf->{walk_speed} );
430 }
431 19 ▶ if ( $conf->{with_bike} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"with_bike"}) 1 18 19
432 1 $self->with_bike(1);
433 }
434 19 ▶ if ( $conf->{with_low_platform} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"with_low_platform"}) 0 19 19
435 0 $self->with_low_platform(1);
436 }
437 19 ▶ if ( $conf->{with_wheelchair} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"with_wheelchair"}) 0 19 19
438 0 $self->with_wheelchair(1);
439 }
440 19 ▶ if ( $conf->{without_solid_stairs} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"without_solid_stairs"}) 0 19 19
441 0 $self->without_solid_stairs(1);
442 }
443 19 ▶ if ( $conf->{without_escalators} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"without_escalators"}) 0 19 19
444 0 $self->without_escalators(1);
445 }
446 19 ▶ if ( $conf->{without_elevators} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf->{"without_elevators"}) 0 19 19
447 0 $self->without_elevators(1);
448 }
449  
450 19 for my $val ( values %{ $self->{post} } ) {
451 1309 $val = encode( 'UTF-8', $val );
452 }
453  
454 19 return;
455 }
456  
457 27 ▶sub new {
Subroutine new: called CC=4 SCAR=15.2
Pod documented
458 27 my ( $obj, %conf ) = @_;
459  
460 27 my $ref = {};
461  
462 27 $ref->{config} = \%conf;
463  
464 27 bless( $ref, $obj );
465  
466 27 ▶ if ( not $ref->{config}->{efa_url} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($ref->{"config"}{"efa_url"}) 0 27 27
467 0 Travel::Routing::DE::EFA::Exception::Setup->throw(
468 option => 'efa_url',
469 error => 'must be set'
470 );
471 }
472  
473 27 $ref->{config}->{efa_url} =~ m{
474 (?<netroot> (?<root> [^:]+ : // [^/]+ ) / [^/]+ / )
475 }ox;
476  
477 27 $ref->{config}->{rm_base} = $+{netroot};
478 27 $ref->{config}->{sm_base} = $+{root} . '/download/envmaps/';
479  
480 27 $ref->create_post;
481  
482 19 ▶ if ( not( defined $conf{submit} and $conf{submit} == 0 ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $conf{"submit"} and $conf{"submit"} == 0) 0 19 19
Condition33%1/3
defined $conf{"submit"} and $conf{"submit"} == 0
!ll&&!rl&&r
0019
MC/DC0%0/2
defined $conf{"submit"} and $conf{"submit"} == 0
defined $conf{"submit"} $conf{"submit"} == 0
Truth table33%1/3
A and B
A= defined $conf{"submit"}B= $conf{"submit"} == 0
ABresult
0X0
100
111
483 0 $ref->submit( %{ $conf{lwp_options} } );
484 }
485  
486 19 return $ref;
487 }
488  
489 1 ▶sub new_from_xml {
Subroutine new_from_xml: called CC=1 SCAR=0.0
Pod undocumented
490 1 my ( $class, %opt ) = @_;
491  
492 1 my $self = { xml_reply => $opt{xml} };
493  
494 $self->{config} = {
495 efa_url => $opt{efa_url},
496 1 };
497  
498 1 $self->{config}->{efa_url} =~ m{
499 (?<netroot> (?<root> [^:]+ : // [^/]+ ) / [^/]+ / )
500 }ox;
501  
502 1 $self->{config}->{rm_base} = $+{netroot};
503 1 $self->{config}->{sm_base} = $+{root} . '/download/envmaps/';
504  
505 1 bless( $self, $class );
506  
507 1 $self->parse_xml;
508  
509 1 return $self;
510 }
511  
512 0 ▶sub submit {
Subroutine submit: not called CC=4 SCAR=30.0
Pod documented
513 0 my ( $self, %conf ) = @_;
514  
515 0 $self->{ua} = LWP::UserAgent->new(%conf);
516 0 $self->{ua}->env_proxy;
517  
518 0 ▶ if ( $self->{config}{developer_mode} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"config"}{"developer_mode"}) 0 0 0
519 0 say 'POST ' . $self->{config}{efa_url};
520 0 ▶ while ( my ( $key, $value ) = each %{ $self->{post} } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$$self{"post"};}) 0 0 0
521 0 printf( "%30s = %s\n", $key, $value );
522 }
523 }
524  
525 my $response
526 0 = $self->{ua}->post( $self->{config}->{efa_url}, $self->{post} );
527  
528 0 ▶ if ( $response->is_error ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($response->is_error) 0 0 0
529 0 Travel::Routing::DE::EFA::Exception::Net->throw(
530 http_response => $response,
531 );
532 }
533  
534 0 $self->{xml_reply} = $response->decoded_content;
535  
536 0 $self->parse_xml;
537  
538 0 return;
539 }
540  
541 74 ▶sub itddate_str {
Subroutine itddate_str: called CC=1 SCAR=0.0
Pod undocumented
542 74 my ( $self, $node ) = @_;
543  
544 74 return sprintf( '%02d.%02d.%04d',
545 $node->getAttribute('day'),
546 $node->getAttribute('month'),
547 $node->getAttribute('year') );
548 }
549  
550 74 ▶sub itdtime_str {
Subroutine itdtime_str: called CC=1 SCAR=0.0
Pod undocumented
551 74 my ( $self, $node ) = @_;
552  
553 74 return sprintf( '%02d:%02d',
554 $node->getAttribute('hour'),
555 $node->getAttribute('minute') );
556 }
557  
558 0 ▶sub parse_cur_info {
Subroutine parse_cur_info: not called CC=2 SCAR=17.9
Pod undocumented
559 0 my ( $self, $node ) = @_;
560  
561 0 my $xp_text = XML::LibXML::XPathExpression->new('./infoLinkText');
562 0 my $xp_subject = XML::LibXML::XPathExpression->new('./infoText/subject');
563 0 my $xp_subtitle = XML::LibXML::XPathExpression->new('./infoText/subtitle');
564 0 my $xp_content = XML::LibXML::XPathExpression->new('./infoText/content');
565  
566 0 my $e_text = ( $node->findnodes($xp_text) )[0];
567 0 my $e_subject = ( $node->findnodes($xp_subject) )[0];
568 0 my $e_subtitle = ( $node->findnodes($xp_subtitle) )[0];
569 0 my $e_content = ( $node->findnodes($xp_content) )[0];
570  
571 0 my %msg = (
572 summary => $e_text->textContent,
573 subject => $e_subject->textContent,
574 subtitle => $e_subtitle->textContent,
575 raw_content => $e_content->textContent,
576 );
577 0 for my $key ( keys %msg ) {
578 0 chomp( $msg{$key} );
579 }
580 0 return Travel::Routing::DE::EFA::Route::Message->new(%msg);
581 }
582  
583 5 ▶sub parse_reg_info {
Subroutine parse_reg_info: called CC=1 SCAR=0.0
Pod undocumented
584 5 my ( $self, $node ) = @_;
585  
586 5 my %msg = (
587 summary => $node->textContent,
588 );
589  
590 5 return Travel::Routing::DE::EFA::Route::Message->new(%msg);
591 }
592  
593 4 ▶sub parse_xml_part {
Subroutine parse_xml_part: called CC=19 SCAR=29.7
Pod undocumented
594 4 my ( $self, $route ) = @_;
595  
596 4 my $xp_route = XML::LibXML::XPathExpression->new(
597 './itdPartialRouteList/itdPartialRoute');
598 4 my $xp_dep
599 = XML::LibXML::XPathExpression->new('./itdPoint[@usage="departure"]');
600 4 my $xp_arr
601 = XML::LibXML::XPathExpression->new('./itdPoint[@usage="arrival"]');
602 4 my $xp_date = XML::LibXML::XPathExpression->new('./itdDateTime/itdDate');
603 4 my $xp_time = XML::LibXML::XPathExpression->new('./itdDateTime/itdTime');
604 4 my $xp_via = XML::LibXML::XPathExpression->new('./itdStopSeq/itdPoint');
605  
606 4 my $xp_sdate
607 = XML::LibXML::XPathExpression->new('./itdDateTimeTarget/itdDate');
608 4 my $xp_stime
609 = XML::LibXML::XPathExpression->new('./itdDateTimeTarget/itdTime');
610 4 my $xp_mot = XML::LibXML::XPathExpression->new('./itdMeansOfTransport');
611 4 my $xp_fp = XML::LibXML::XPathExpression->new('./itdFootPathInfo');
612 4 my $xp_fp_e
613 = XML::LibXML::XPathExpression->new('./itdFootPathInfo/itdFootPathElem');
614 4 my $xp_delay = XML::LibXML::XPathExpression->new('./itdRBLControlled');
615  
616 4 my $xp_sched_info
617 = XML::LibXML::XPathExpression->new('./itdInfoTextList/infoTextListElem');
618 4 my $xp_cur_info = XML::LibXML::XPathExpression->new('./infoLink');
619  
620 4 my $xp_mapitem_rm = XML::LibXML::XPathExpression->new(
621 './itdMapItemList/itdMapItem[@type="RM"]/itdImage');
622 4 my $xp_mapitem_sm = XML::LibXML::XPathExpression->new(
623 './itdMapItemList/itdMapItem[@type="SM"]/itdImage');
624  
625 4 my $xp_fare
626 = XML::LibXML::XPathExpression->new('./itdFare/itdSingleTicket');
627  
628 4 my @route_parts;
629  
630 4 my $info = {
631 duration => $route->getAttribute('publicDuration'),
632 vehicle_time => $route->getAttribute('vehicleTime'),
633 };
634  
635 4 my $e_fare = ( $route->findnodes($xp_fare) )[0];
636  
637 4 ▶ if ($e_fare) {
Branch: 1 branch
BranchTrueFalseTotal
if ($e_fare) 4 0 4
638 4 $info->{ticket_type} = $e_fare->getAttribute('unitsAdult');
639 4 $info->{fare_adult} = $e_fare->getAttribute('fareAdult');
640 4 $info->{fare_child} = $e_fare->getAttribute('fareChild');
641 4 $info->{ticket_text} = $e_fare->textContent;
642 }
643  
644 4 for my $e ( $route->findnodes($xp_route) ) {
645  
646 10 my $e_dep = ( $e->findnodes($xp_dep) )[0];
647 10 my $e_arr = ( $e->findnodes($xp_arr) )[0];
648 10 my $e_ddate = ( $e_dep->findnodes($xp_date) )[0];
649 10 my $e_dtime = ( $e_dep->findnodes($xp_time) )[0];
650 10 my $e_dsdate = ( $e_dep->findnodes($xp_sdate) )[0];
651 10 my $e_dstime = ( $e_dep->findnodes($xp_stime) )[0];
652 10 my $e_adate = ( $e_arr->findnodes($xp_date) )[0];
653 10 my $e_atime = ( $e_arr->findnodes($xp_time) )[0];
654 10 my $e_asdate = ( $e_arr->findnodes($xp_sdate) )[0];
655 10 my $e_astime = ( $e_arr->findnodes($xp_stime) )[0];
656 10 my $e_mot = ( $e->findnodes($xp_mot) )[0];
657 10 my $e_delay = ( $e->findnodes($xp_delay) )[0];
658 10 my $e_fp = ( $e->findnodes($xp_fp) )[0];
659 10 my @e_sinfo = $e->findnodes($xp_sched_info);
660 10 my @e_cinfo = $e->findnodes($xp_cur_info);
661 10 my @e_dmap_rm = $e_dep->findnodes($xp_mapitem_rm);
662 10 my @e_dmap_sm = $e_dep->findnodes($xp_mapitem_sm);
663 10 my @e_amap_rm = $e_arr->findnodes($xp_mapitem_rm);
664 10 my @e_amap_sm = $e_arr->findnodes($xp_mapitem_sm);
665 10 my @e_fp_e = $e->findnodes($xp_fp_e);
666  
667 # not all EFA services distinguish between scheduled and realtime
668 # data. Set sdate / stime to date / time when not provided.
669 10 ▶ $e_dsdate //= $e_ddate;
Condition33%1/3
$e_dsdate //= $e_ddate
l!l&&r!l&&!r
1000
MC/DC0%0/2
$e_dsdate //= $e_ddate
$e_dsdate $e_ddate
Truth table33%1/3
A //= B
A= $e_dsdateB= $e_ddate
ABresult
1X1
011
000
670 10 ▶ $e_dstime //= $e_dtime;
Condition33%1/3
$e_dstime //= $e_dtime
l!l&&r!l&&!r
1000
MC/DC0%0/2
$e_dstime //= $e_dtime
$e_dstime $e_dtime
Truth table33%1/3
A //= B
A= $e_dstimeB= $e_dtime
ABresult
1X1
011
000
671 10 ▶ $e_asdate //= $e_adate;
Condition33%1/3
$e_asdate //= $e_adate
l!l&&r!l&&!r
1000
MC/DC0%0/2
$e_asdate //= $e_adate
$e_asdate $e_adate
Truth table33%1/3
A //= B
A= $e_asdateB= $e_adate
ABresult
1X1
011
000
672 10 ▶ $e_astime //= $e_atime;
Condition33%1/3
$e_astime //= $e_atime
l!l&&r!l&&!r
1000
MC/DC0%0/2
$e_astime //= $e_atime
$e_astime $e_atime
Truth table33%1/3
A //= B
A= $e_astimeB= $e_atime
ABresult
1X1
011
000
673  
674 10 ▶ my $delay = $e_delay ? $e_delay->getAttribute('delayMinutes') : 0;
Branch: 1 branch
BranchTrueFalseTotal
$e_delay ? : 5 5 10
675 10 ▶ my $delay_arr
Branch: 1 branch
BranchTrueFalseTotal
$e_delay ? : 5 5 10
676 = $e_delay ? $e_delay->getAttribute('delayMinutesArr') : 0;
677  
678 10 my ( @dep_rms, @dep_sms, @arr_rms, @arr_sms );
679  
680 10 ▶ if ( $self->{config}->{rm_base} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"config"}{"rm_base"}) 10 0 10
681 10 my $base = $self->{config}->{rm_base};
682 10 @dep_rms = map { $base . $_->getAttribute('src') } @e_dmap_rm;
683 10 @arr_rms = map { $base . $_->getAttribute('src') } @e_amap_rm;
684 }
685 10 ▶ if ( $self->{config}->{sm_base} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"config"}{"sm_base"}) 10 0 10
686 10 my $base = $self->{config}->{sm_base};
687 10 @dep_sms = map { $base . $_->getAttribute('src') } @e_dmap_sm;
688 10 @arr_sms = map { $base . $_->getAttribute('src') } @e_amap_sm;
689 }
690  
691 10 my $hash = {
692 departure_date => $self->itddate_str($e_ddate),
693 departure_delay => $delay,
694 departure_time => $self->itdtime_str($e_dtime),
695 departure_sdate => $self->itddate_str($e_dsdate),
696 departure_stime => $self->itdtime_str($e_dstime),
697 departure_stop => $e_dep->getAttribute('name'),
698 departure_platform => $e_dep->getAttribute('platformName'),
699 occupancy => $e_dep->getAttribute('occupancy'),
700 train_line => $e_mot->getAttribute('name'),
701 train_product => $e_mot->getAttribute('productName'),
702 train_destination => $e_mot->getAttribute('destination'),
703 arrival_date => $self->itddate_str($e_adate),
704 arrival_delay => $delay_arr,
705 arrival_time => $self->itdtime_str($e_atime),
706 arrival_sdate => $self->itddate_str($e_asdate),
707 arrival_stime => $self->itdtime_str($e_astime),
708 arrival_stop => $e_arr->getAttribute('name'),
709 arrival_platform => $e_arr->getAttribute('platformName'),
710 };
711  
712 10 ▶ if ($e_fp) {
Branch: 1 branch
BranchTrueFalseTotal
if ($e_fp) 5 5 10
713  
714 # Note that position=IDEST footpaths are coupled with a special
715 # "walking" connection, so their duration is already known and
716 # accounted for. However, we still save it here, since
717 # detecting and handling this is the API client's job (for now).
718 5 $hash->{footpath_type} = $e_fp->getAttribute('position');
719 5 $hash->{footpath_duration} = $e_fp->getAttribute('duration');
720 5 for my $e (@e_fp_e) {
721 push(
722 5 @{ $hash->{footpath_parts} },
723 [ $e->getAttribute('type'), $e->getAttribute('level') ]
724 );
725 }
726 }
727  
728 10 $hash->{departure_routemaps} = \@dep_rms;
729 10 $hash->{departure_stationmaps} = \@dep_sms;
730 10 $hash->{arrival_routemaps} = \@arr_rms;
731 10 $hash->{arrival_stationmaps} = \@arr_sms;
732  
733 10 for my $ve ( $e->findnodes($xp_via) ) {
734 62 my $e_vdate = ( $ve->findnodes($xp_date) )[0];
735 62 my $e_vtime = ( $ve->findnodes($xp_time) )[0];
736  
737 62 ▶ if ( not( $e_vdate and $e_vtime )
Branch: 1 branch
BranchTrueFalseTotal
if (not $e_vdate && $e_vtime or $e_vdate->getAttribute("weekday") == -1) 10 52 62
Condition50%3/6
not $e_vdate && $e_vtime or $e_vdate->getAttribute("weekday") == -1
l!l&&r!l&&!r
01052
$e_vdate && $e_vtime
!ll&&!rl&&r
0062
MC/DC33%1/3
not $e_vdate && $e_vtime or $e_vdate->getAttribute("weekday") == -1
$e_vdate $e_vtime $e_vdate->getAttribute("weekday") == -1
Truth table50%2/4
not(A && B) or C
A= $e_vdateB= $e_vtimeC= $e_vdate->getAttribute("weekday") == -1
ABCresult
0XX1
10X1
1111
1100
738 or ( $e_vdate->getAttribute('weekday') == -1 ) )
739 {
740 10 next;
741 }
742  
743 52 my $name = $ve->getAttribute('name');
744 52 my $platform = $ve->getAttribute('platformName');
745 52 my $arr_delay = $ve->getAttribute('arrDelay');
746  
747 52 ▶ if ( $name eq $hash->{departure_stop}
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq $hash->{"departure_stop"} or $name eq $hash->{"arrival_stop"}) 18 34 52
Condition100%3/3
$name eq $hash->{"departure_stop"} or $name eq $hash->{"arrival_stop"}
l!l&&r!l&&!r
71134
MC/DC100%2/2
$name eq $hash->{"departure_stop"} or $name eq $hash->{"arrival_stop"}
$name eq $hash->{"departure_stop"} $name eq $hash->{"arrival_stop"}
Truth table100%3/3
A or B
A= $name eq $hash->{"departure_stop"}B= $name eq $hash->{"arrival_stop"}
ABresult
1X1
011
000
748 or $name eq $hash->{arrival_stop} )
749 {
750 18 next;
751 }
752  
753 push(
754 34 @{ $hash->{via} },
755 [
756 $self->itddate_str($e_vdate),
757 $self->itdtime_str($e_vtime),
758 $name,
759 $platform,
760 $arr_delay,
761 ]
762 );
763 }
764  
765 $hash->{regular_notes}
766 10 = [ map { $self->parse_reg_info($_) } @e_sinfo ];
767 0 $hash->{current_notes} = [ map { $self->parse_cur_info($_) } @e_cinfo ];
768  
769 10 push( @route_parts, $hash );
770 }
771  
772 push(
773 4 @{ $self->{routes} },
774 Travel::Routing::DE::EFA::Route->new( $info, @route_parts )
775 );
776  
777 4 return;
778 }
779  
780 1 ▶sub parse_xml {
Subroutine parse_xml: called CC=7 SCAR=21.1
Pod undocumented
781 1 my ($self) = @_;
782  
783 my $tree = $self->{tree} = XML::LibXML->load_xml(
784 string => $self->{xml_reply},
785 1 );
786  
787 1 ▶ if ( $self->{config}->{developer_mode} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"config"}{"developer_mode"}) 0 1 1
788 0 say $tree->toString(2);
789 }
790  
791 1 my $xp_element = XML::LibXML::XPathExpression->new(
792 '//itdItinerary/itdRouteList/itdRoute');
793 1 my $xp_err = XML::LibXML::XPathExpression->new(
794 '//itdTripRequest/itdMessage[@type="error"]');
795 1 my $xp_odv = XML::LibXML::XPathExpression->new('//itdOdv');
796  
797 1 for my $odv ( $tree->findnodes($xp_odv) ) {
798 3 $self->check_ambiguous_xml($odv);
799 }
800  
801 1 my $err = ( $tree->findnodes($xp_err) )[0];
802 1 ▶ if ($err) {
Branch: 1 branch
BranchTrueFalseTotal
if ($err) 0 1 1
803 0 Travel::Routing::DE::EFA::Exception::Other->throw(
804 message => $err->textContent );
805 }
806  
807 1 for my $part ( $tree->findnodes($xp_element) ) {
808 4 $self->parse_xml_part($part);
809 }
810  
811 1 ▶ if ( not defined $self->{routes} or @{ $self->{routes} } == 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $self->{"routes"} or @{$self->{"routes"};} == 0) 0 1 1
Condition33%1/3
not defined $self->{"routes"} or @{$self->{"routes"};} == 0
l!l&&r!l&&!r
001
MC/DC0%0/2
not defined $self->{"routes"} or @{$self->{"routes"};} == 0
not defined $self->{"routes"} @{$self->{"routes"};} == 0
Truth table33%1/3
not(A) or B
A= not defined $self->{"routes"}B= @{$self->{"routes"};} == 0
ABresult
1X1
011
000
812 0 Travel::Routing::DE::EFA::Exception::NoData->throw;
813 }
814  
815 1 return 1;
816 }
817  
818 3 ▶sub check_ambiguous_xml {
Subroutine check_ambiguous_xml: called CC=7 SCAR=23.8
Pod undocumented
819 3 my ( $self, $tree ) = @_;
820  
821 3 my $xp_place = XML::LibXML::XPathExpression->new('./itdOdvPlace');
822 3 my $xp_name = XML::LibXML::XPathExpression->new('./itdOdvName');
823  
824 3 my $xp_place_elem = XML::LibXML::XPathExpression->new('./odvPlaceElem');
825 3 my $xp_place_input = XML::LibXML::XPathExpression->new('./odvPlaceInput');
826 3 my $xp_name_elem = XML::LibXML::XPathExpression->new('./odvNameElem');
827 3 my $xp_name_input = XML::LibXML::XPathExpression->new('./odvNameInput');
828  
829 3 my $e_place = ( $tree->findnodes($xp_place) )[0];
830 3 my $e_name = ( $tree->findnodes($xp_name) )[0];
831  
832 3 ▶ if ( not( $e_place and $e_name ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($e_place and $e_name) 0 3 3
Condition33%1/3
$e_place and $e_name
!ll&&!rl&&r
003
MC/DC0%0/2
$e_place and $e_name
$e_place $e_name
Truth table33%1/3
A and B
A= $e_placeB= $e_name
ABresult
0X0
100
111
833 0 cluck('skipping ambiguity check - itdOdvPlace/itdOdvName missing');
834 0 return;
835 }
836  
837 3 my $s_place = $e_place->getAttribute('state');
838 3 my $s_name = $e_name->getAttribute('state');
839  
840 3 ▶ if ( $s_place eq 'list' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s_place eq "list") 0 3 3
841 Travel::Routing::DE::EFA::Exception::Ambiguous->throw(
842 post_key => 'place',
843 post_value =>
844 ( $e_place->findnodes($xp_place_input) )[0]->textContent,
845 possibilities => join( q{ | },
846 0 map { $_->textContent }
847 0 @{ $e_place->findnodes($xp_place_elem) } )
848 );
849 }
850 3 ▶ if ( $s_name eq 'list' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s_name eq "list") 0 3 3
851 Travel::Routing::DE::EFA::Exception::Ambiguous->throw(
852 post_key => 'name',
853 post_value =>
854 ( $e_name->findnodes($xp_name_input) )[0]->textContent,
855 possibilities => join( q{ | },
856 0 map { $_->textContent } @{ $e_name->findnodes($xp_name_elem) } )
857 );
858 }
859  
860 3 ▶ if ( $s_place eq 'notidentified' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s_place eq "notidentified") 0 3 3
861 0 Travel::Routing::DE::EFA::Exception::Setup->throw(
862 option => 'place',
863 error => 'unknown place',
864 have => ( $e_place->findnodes($xp_place_input) )[0]->textContent,
865 );
866 }
867 3 ▶ if ( $s_name eq 'notidentified' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s_name eq "notidentified") 0 3 3
868 0 Travel::Routing::DE::EFA::Exception::Setup->throw(
869 option => 'name',
870 error => 'unknown name',
871 have => ( $e_name->findnodes($xp_name_input) )[0]->textContent,
872 );
873 }
874  
875 # 'identified' and 'empty' are ok
876  
877 3 return;
878 }
879  
880 2 ▶sub routes {
Subroutine routes: called CC=1 SCAR=0.0
Pod documented
881 2 my ($self) = @_;
882  
883 2 return @{ $self->{routes} };
884 }
885  
886 # static
887 0 ▶sub get_efa_urls {
Subroutine get_efa_urls: not called CC=1 SCAR=6.9
Pod documented
888  
889 # sorted lexically by shortname
890 # BEG (from Travel::Status::DE::VRR) does not work here
891 return (
892 {
893 0 url => 'https://bsvg.efa.de/bsvagstd/XML_TRIP_REQUEST2',
894 name => 'Braunschweiger Verkehrs-GmbH',
895 shortname => 'BSVG',
896 },
897 {
898 url => 'https://www.ding.eu/ding3/XSLT_TRIP_REQUEST2',
899 name => 'Donau-Iller Nahverkehrsverbund',
900 shortname => 'DING',
901 },
902 {
903 url => 'https://projekte.kvv-efa.de/sl3-alone/XSLT_TRIP_REQUEST2',
904 name => 'Karlsruher Verkehrsverbund',
905 shortname => 'KVV',
906 },
907 {
908 url => 'https://www.linzag.at/static/XSLT_TRIP_REQUEST2',
909 name => 'Linz AG',
910 shortname => 'LinzAG',
911 },
912 {
913 url => 'https://efa.mvv-muenchen.de/mobile/XSLT_TRIP_REQUEST2',
914 name => 'Münchner Verkehrs- und Tarifverbund',
915 shortname => 'MVV',
916 },
917 {
918 url => 'https://www.efa-bw.de/nvbw/XSLT_TRIP_REQUEST2',
919 name => 'Nahverkehrsgesellschaft Baden-Württemberg',
920 shortname => 'NVBW',
921 },
922 {
923 url => 'https://westfalenfahrplan.de/nwl-efa/XML_TRIP_REQUEST2',
924 name => 'Nahverkehr Westfalen-Lippe',
925 shortname => 'NWL',
926 },
927 {
928 url => 'https://efa.vagfr.de/vagfr3/XSLT_TRIP_REQUEST2',
929 name => 'Freiburger Verkehrs AG',
930 shortname => 'VAG',
931 },
932 {
933 url => 'https://efa.vgn.de/vgnExt_oeffi/XML_TRIP_REQUEST2',
934 name => 'Verkehrsverbund Grossraum Nuernberg',
935 shortname => 'VGN',
936 },
937  
938 # HTTPS: certificate verification fails
939 {
940 url => 'http://efa.vmv-mbh.de/vmv/XML_TRIP_REQUEST2',
941 name => 'Verkehrsgesellschaft Mecklenburg-Vorpommern',
942 shortname => 'VMV',
943 },
944 {
945 url => 'https://www.vrn.de/mngvrn/XML_TRIP_REQUEST2',
946 name => 'Verkehrsverbund Rhein-Neckar',
947 shortname => 'VRN',
948 },
949 {
950 url => 'https://app.vrr.de/vrrstd/XML_TRIP_REQUEST2',
951 name => 'Verkehrsverbund Rhein-Ruhr',
952 shortname => 'VRR',
953 },
954 {
955 url => 'https://efa.vrr.de/rbgstd3/XSLT_TRIP_REQUEST2',
956 name => 'Verkehrsverbund Rhein-Ruhr (alternative)',
957 shortname => 'VRR2',
958 },
959 {
960 url => 'https://efa.vvo-online.de/VMSSL3/XSLT_TRIP_REQUEST2',
961 name => 'Verkehrsverbund Oberelbe',
962 shortname => 'VVO',
963 },
964 {
965 url => 'https://www2.vvs.de/vvs/XSLT_TRIP_REQUEST2',
966 name => 'Verkehrsverbund Stuttgart',
967 shortname => 'VVS',
968 },
969 );
970 }
971  
972 2 1;
973  
974 __END__
↑ Summary EFA/Route/Part.pm »