flight_status() { if [[ $# -eq 3 ]];then offset=$3; else offset=0; fi; curl "http://mobile.flightview.com/TrackByRoute.aspx?view=detail&al="$1"&fn="$2"&dpdat=$(cu-date +%Y%m%d -d ${offset}day)" 2>/dev/null |html2text |grep ":"; } ▐
$ flight_status LH 471 Status: In Air Departure: Toronto, ON (YYZ) Scheduled: 6:15 PM, Feb 20 Takeoff: 6:41 PM, Feb 20 Term-Gate: Terminal T1 - 172 Arrival: Frankfurt, Germany (FRA) Scheduled: 8:05 AM, Feb 21 Estimated: 8:23 AM, Feb 21 Remaining: 3 hr 41 min Term-Gate: Terminal 1
$ flight_status LH 471 +1 Status: Scheduled Departure: Toronto, ON (YYZ) Scheduled: 6:15 PM, Feb 21 Term-Gate: Terminal T1 - 173 Arrival: Frankfurt, Germany (FRA) Scheduled: 8:05 AM, Feb 22 Term-Gate: Terminal 1
$ flight_status LH 471 -1 Status: Arrived Departure: Toronto, ON (YYZ) Scheduled: 6:15 PM, Feb 19 Takeoff: 6:31 PM, Feb 19 Term-Gate: Terminal T1 - 172 Arrival: Frankfurt, Germany (FRA) Scheduled: 8:05 AM, Feb 20 At Gate: 8:30 AM, Feb 20 Term-Gate: Terminal 1
# mv cu-date.rename /usr/bin/cu-date # chmod +x /usr/bin/cu-date
flight_status() { if [[ $# -eq 3 ]];then offset=$3; else offset=0; fi; curl "http://mobile.flightview.com/TrackByRoute.aspx?view=detail&al="$1"&fn="$2"&dpdat=$(date +%Y%m%d -d ${offset}day)" 2>/dev/null |html2text |grep ":"; } ▐
$ flight_status LH 471 +x date: invalid date `+xday' Departing: ???, ?? Arriving: ???, ?? Time: - Date: Mon, January 1 Actual Takeoff: 6:31*PM, Feb*19 At Gate: 8:30*AM, Feb*20 Actual Takeoff: 6:41*PM, Feb*20 Estimated Arrival: 8:19*AM, Feb*21 Scheduled Departure: 6:15*PM, Feb*21 Scheduled Arrival: 8:05*AM, Feb*22 Scheduled Departure: 6:15*PM, Feb*23 Scheduled Arrival: 8:05*AM, Feb*24 --More--