diff options
Diffstat (limited to 'flightquery.sh')
-rwxr-xr-x | flightquery.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/flightquery.sh b/flightquery.sh index b725350..2382fa6 100755 --- a/flightquery.sh +++ b/flightquery.sh @@ -33,8 +33,9 @@ _getdata() { _arrivals() { _getdata + result=$(echo $result | jq '.data | sort_by(.arrival.scheduled)') # TODO: Sort by something (arrival time?), limit to a certin number of flights (X before current time and Y after?) and format on single line of output - for json in $(echo "${result}" | jq -r '.data[] | @base64') + for json in $(echo "${result}" | jq -r '.[] | @base64') do origin=$(_jq '.departure.airport') takeoffSched=$(_jq '.departure.scheduled') @@ -47,15 +48,16 @@ _arrivals() { _departures() { _getdata + result=$(echo $result | jq '.data | sort_by(.departure.scheduled)') # TODO: Sort by something (departure time?), limit to a certin number of flights (X before current time and Y after?) and format on single line of output - for json in $(echo "${result}" | jq -r '.data[] | @base64') + for json in $(echo "${result}" | jq -r '.[] | @base64') do destination=$(_jq '.arrival.airport') takeoffSched=$(_jq '.departure.scheduled') landingSched=$(_jq '.arrival.scheduled') airline=$(_jq '.airline.name') flightNumber=$(_jq '.flight.number') - echo "$airline $flightNumber destination: $destination Takeoff: $takeoffSched Landed: $landingSched" + echo "$airline $flightNumber Destination: $destination Takeoff: $takeoffSched Landed: $landingSched" done } |