From bba45062f265a373d21f121ca2cb5029f1fab034 Mon Sep 17 00:00:00 2001 From: Asa Venton Date: Sat, 31 Oct 2020 06:00:51 +0000 Subject: Add support for actual takeoff and landing times in _arrivals and _departures. --- flightquery.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'flightquery.sh') diff --git a/flightquery.sh b/flightquery.sh index 5379b91..bb4ed2c 100755 --- a/flightquery.sh +++ b/flightquery.sh @@ -68,15 +68,20 @@ _flight() { origin=$(echo $result | jq -r '.data[0].departure.iata') takeoffSched=$(echo $result | jq -r '.data[0].departure.scheduled') takeoffEst=$(echo $result | jq -r '.data[0].departure.estimated') + takeoffActual=$(echo $result | jq -r '.data[0].departure.actual') takeoffDelay=$(echo $result | jq -r '.data[0].departure.delay') destination=$(echo $result | jq -r '.data[0].arrival.iata') landingSched=$(echo $result | jq -r '.data[0].arrival.scheduled') landingEst=$(echo $result | jq -r '.data[0].arrival.estimated') + landingActual=$(echo $result | jq -r '.data[0].arrival.actual') landingDelay=$(echo $result | jq -r '.data[0].arrival.delay') - # Build output string giving estimated times and delays where available. + # Build output string giving actual or estimated times and delays where available. output="$airline - Origin: $origin " - if [[ "$takeoffEst" != "null" ]] + if [[ "$takeoffActual" != "null" ]] + then + output="$output $takeoffActual" + elif [[ "$takeoffEst" != "null" ]] then output="$output $takeoffEst" else @@ -89,8 +94,10 @@ _flight() { fi output="$output Dest: $destination" - - if [[ "$landingEst" != "null" ]] + if [[ "$landingActual" != "null" ]] + then + output="$output $landingActual" + elif [[ "$landingEst" != "null" ]] then output="$output $landingEst" else -- cgit v1.2.3