From ce6237b9fb7f068b2ffaa866a096ffbdc0046870 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 26 Jan 2020 09:59:45 +0100 Subject: status API: nextStops -> intermediateStops; documentation --- lib/Travelynx.pm | 6 +++--- templates/api_documentation.html.ep | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 96b45be..66cac2e 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -3205,8 +3205,8 @@ sub startup { no => $status->{train_no}, id => $status->{train_id}, }, - actionTime => $status->{timestamp}->epoch, - nextStops => [], + actionTime => $status->{timestamp}->epoch, + intermediateStops => [], }; for my $stop ( @{ $status->{route_after} // [] } ) { @@ -3215,7 +3215,7 @@ sub startup { last; } push( - @{ $ret->{nextStops} }, + @{ $ret->{intermediateStops} }, { name => $stop->[0], scheduledArrival => $stop->[1]{sched_arr} diff --git a/templates/api_documentation.html.ep b/templates/api_documentation.html.ep index 73f02cb..0c8c534 100644 --- a/templates/api_documentation.html.ep +++ b/templates/api_documentation.html.ep @@ -39,7 +39,7 @@ "latitude" : 51.451355,
"longitude" : 7.014793,
"scheduledTime": 1556083680,
- "realTime": 1556083680,
+ "realTime": 1556083680
},
"toStation" : { (zugehöriger Checkout. Wenn noch nicht eingetragen, sind alle Felder null)
"name" : "Essen Stadtwald",
@@ -48,8 +48,18 @@ "latitude" : 51.422853,
"longitude" : 7.023296,
"scheduledTime": 1556083980, (ggf. null)
- "realTime": 1556083980, (ggf. null)
+ "realTime": 1556083980 (ggf. null)
},
+ "intermediateStops" : [ (Unterwegshalte zwischen fromStation und toStation)
+ {
+ "name" : "Essen Süd",
+ "scheduledArrival" : 1556083800, (ggf. null)
+ "realArrival" : 1556083800, (ggf. null, nach Ankunft identisch mit scheduledArrival)
+ "scheduledDeparture" : 1556083860, (ggf. null)
+ "realDeparture" : 1556083860 (ggf. null, nach Abfahrt identisch mit scheduledDeparture)
+ },
+ …
+ ],
"train" : {
"type" : "S", (aktueller / letzter Zugtyp)
"line" : "6", (Linie als String, nicht immer numerisch, ggf. null)
-- cgit v1.2.3