Skip to content
GitLab
Explore
Sign in
derf
Travel-Routing-DE-HAFAS
Compare revisions
cdff0a8efeba471abe297b431160af27e3573905 to 1557c7162f2192acd1a3970f03581a0b516af193
Commits on Source (2)
ÖBB: increase HAFAS version to avoid rare incompatibilities
· 791439d5
Birte Kristina Friesel
authored
Feb 25, 2024
791439d5
Update ÖBB productbits and add descriptions to list
· 1557c716
Birte Kristina Friesel
authored
Feb 25, 2024
1557c716
Hide whitespace changes
Inline
Side-by-side
bin/hafas
View file @
1557c716
...
...
@@ -156,10 +156,14 @@ sub parse_mot_options {
my
$desc
=
Travel::Routing::DE::HAFAS::
get_service
(
$service
);
if
(
$desc
)
{
my
@mots
=
@
{
$desc
->
{
productbits
}
};
@mots
=
grep
{
$_
ne
'
x
'
}
@mots
;
@mots
=
uniq
@mots
;
@mots
=
sort
@mots
;
say
join
(
"
\n
",
@mots
);
for
my
$mot
(
@
{
$desc
->
{
productbits
}
}
)
{
if
(
ref
(
$mot
)
eq
'
ARRAY
'
)
{
printf
(
"
%-10s %s
\n
",
@
{
$mot
}
);
}
else
{
say
$mot
;
}
}
exit
0
;
}
else
{
...
...
lib/Travel/Routing/DE/HAFAS.pm
View file @
1557c716
...
...
@@ -108,8 +108,19 @@ my %hafas_instance = (
'
ÖBB
'
=>
{
mgate
=>
'
https://fahrplan.oebb.at/bin/mgate.exe
',
name
=>
'
Österreichische Bundesbahnen
',
productbits
=>
[
qw[ice ice ice regio regio s bus ferry u tram ice ondemand ice]
],
productbits
=>
[
[
ice_rj
=>
'
long distance trains
'
],
[
sev
=>
'
rail replacement service
'
],
[
ic_ec
=>
'
long distance trains
'
],
[
d_n
=>
'
night trains and rapid trains
'
],
[
regio
=>
'
regional trains
'
],
[
s => 'suburban trains' ],
[ bus => 'busses' ],
[ ferry =
>
'
maritime transit
'
],
[
u
=>
'
underground
'
],
[
tram
=>
'
trams
'
],
[
other
=>
'
other transit services
'
]
],
request
=>
{
client
=>
{
id
=>
'
OEBB
',
...
...
@@ -117,7 +128,7 @@ my %hafas_instance = (
type
=>
'
IPH
',
name
=>
'
oebbPROD-ADHOC
',
},
ver
=>
'
1.
41
',
ver
=>
'
1.
57
',
auth
=>
{
type
=>
'
AID
',
aid
=>
'
OWDL4fE4
'
.
'
ixNiPBBm
',
...
...
@@ -379,7 +390,12 @@ sub mot_mask {
my
%mot_pos
;
for
my
$i
(
0
..
$#
{
$hafas_instance
{
$service
}{
productbits
}
}
)
{
$mot_pos
{
$hafas_instance
{
$service
}{
productbits
}[
$i
]
}
=
$i
;
if
(
ref
(
$hafas_instance
{
$service
}{
productbits
}[
$i
]
)
eq
'
ARRAY
'
)
{
$mot_pos
{
$hafas_instance
{
$service
}{
productbits
}[
$i
][
0
]
}
=
$i
;
}
else
{
$mot_pos
{
$hafas_instance
{
$service
}{
productbits
}[
$i
]
}
=
$i
;
}
}
if
(
my
@mots
=
@
{
$self
->
{
exclusive_mots
}
//
[]
}
)
{
...
...