Skip to content
GitLab
Explore
Sign in
derf
Travel-Status-DE-EFA
Compare revisions
5c3b4d7fd61b625621cf2a7aa26649303dc69fde to c7f5e1dc46fb37635dbe106fe93fa62a07b1d1fb
Commits on Source (5)
check-efa-urls: use local source rather than system installation
· 3d798718
Birte Kristina Friesel
authored
Nov 24, 2023
3d798718
efa-m: de-clutter default output (do not show messages by default)
· 5f3e18a6
Birte Kristina Friesel
authored
Nov 24, 2023
5f3e18a6
efa-m: always show real-time data
· 0d4dc017
Birte Kristina Friesel
authored
Nov 24, 2023
0d4dc017
efa-m: identical bracket positions for delays
· 388f59e8
Birte Kristina Friesel
authored
Nov 24, 2023
388f59e8
indicate cancelled departures with --:-- time
· c7f5e1dc
Birte Kristina Friesel
authored
Nov 24, 2023
c7f5e1dc
Hide whitespace changes
Inline
Side-by-side
bin/efa-m
View file @
c7f5e1dc
...
...
@@ -82,6 +82,7 @@ for my $efield (@edata_pre) {
elsif
(
$efield
eq
'
b
'
)
{
$edata
{
route_before
}
=
1
;
$full_routes
=
1
}
elsif
(
$efield
eq
'
f
'
)
{
$edata
{
fullroute
}
=
1
;
$full_routes
=
1
}
elsif
(
$efield
eq
'
r
'
)
{
$edata
{
route
}
=
1
;
$full_routes
=
1
}
elsif
(
$efield
eq
'
m
'
)
{
$edata
{
messages
}
=
1
}
else
{
$edata
{
$efield
}
=
1
}
}
if
(
$filter_via
)
{
...
...
@@ -145,6 +146,14 @@ sub show_version {
exit
0
;
}
sub
format_delay
{
my
(
$delay
,
$len
)
=
@_
;
if
(
$delay
and
$len
)
{
return
sprintf
(
"
(%+
${len}
d)
",
$delay
);
}
return
q{}
;
}
sub
format_route
{
my
(
@route
)
=
@_
;
...
...
@@ -193,7 +202,7 @@ sub display_result {
for
my
$line
(
@lines
)
{
if
(
length
(
$line
->
[
5
]
)
)
{
if
(
$edata
{
messages
}
and
length
(
$line
->
[
5
]
)
)
{
$line
->
[
5
]
=~
tr{\n\x0d}{ }s
;
chomp
$line
->
[
5
];
print
"
\n
";
...
...
@@ -243,6 +252,17 @@ sub show_lines {
sub
show_results
{
my
@output
;
my
$delay_len
=
0
;
my
$delay_fmt
=
0
;
for
my
$d
(
$efa
->
results
)
{
if
(
$d
->
delay
)
{
$delay_len
=
max
(
$delay_len
,
length
(
$d
->
delay
)
+
1
);
}
}
if
(
$delay_len
)
{
$delay_fmt
=
$delay_len
+
3
;
}
for
my
$d
(
$efa
->
results
)
{
my
@output_line
;
...
...
@@ -250,7 +270,7 @@ sub show_results {
my
$dtime
=
(
$relative_times
?
sprintf
(
'
%2d min
',
$d
->
countdown
)
:
$d
->
sched_
time
:
$d
->
time
);
if
(
$d
->
platform_db
)
{
...
...
@@ -276,7 +296,7 @@ sub show_results {
next
;
}
else
{
$dtime
.
=
'
CANCELED
';
$dtime
=
'
--:--
';
}
}
elsif
(
$track_via
)
{
...
...
@@ -284,12 +304,7 @@ sub show_results {
$dtime
.=
'
→
'
.
$via
->
arr_time
;
}
if
(
$d
->
delay
)
{
if
(
$relative_times
)
{
$dtime
.=
'
(+
'
.
$d
->
delay
.
'
)
';
}
else
{
$dtime
.=
'
+
'
.
$d
->
delay
;
}
$dtime
.=
'
'
.
format_delay
(
$d
->
delay
,
$delay_len
);
}
@output_line
...
...
@@ -509,6 +524,12 @@ Show up to three stops between the requested station and the departure's
destination. B<efa-m> tries to display the three most important stops,
however these are heuristically determined and may not be optimal.
=item m / messages
Show free-text messages associated with individual departures. These can
include generic information such is bicycle transportation options or Wi-Fi
availability, delay reasons, and more.
=back
=item B<-p>, B<--platform> I<platforms>
...
...
scripts/check-efa-urls
View file @
c7f5e1dc
...
...
@@ -20,7 +20,7 @@ VVS Stuttgart Schwabstraße"
echo
$checks
|
while
read
service name place
;
do
echo
-n
"
${
service
}
... "
if
bin/efa-m
-s
$service
$name
$place
>
/dev/null
;
then
if
perl
-Ilib
bin/efa-m
-s
$service
$name
$place
>
/dev/null
;
then
echo
OK
fi
done