| 
#!/bin/rc
rfork en
flagfmt='d'
args='CO 380'
if(! ifs=() eval `{aux/getflags $*} || ~ $#* 0){
	aux/usage
	exit usage
}
hget -p 'airline='^$1 -p 'flightNumber='^$2 \
	http://www.flightstats.com/go/FlightStatus/flightStatusByFlight.do |
	htmlfmt > /tmp/flight.$pid
sam -d /tmp/flight.$pid >[2] /dev/null <<'!'
0,/=======\n*/d
/Set Flight Alert/,/FlightStats Mobile!/+1d
/This flight is marketed/,/carrier\(s\):/d
/Travel Checklist/,$d
/Traffic Conditions/-1,/Traffic Report/d
/ What this\?/d
/To see/,/Extended Details/d
,s/Learn More\n//g
,s/:\n/:	/g
,s/\([ 	]/\(/g
,s/\n\n\n+/\n\n/g
,s/\n\(/\n	\(/g
,x/Current Airport Delays/ +1,+2d
,x/FAA Delays/ -3,-1d
,x/Current Weather Conditions/ +1,+2d
,x/Visibility/ +1d
w
!
if (! ~ $flagd '') {
	cat /tmp/flight.$pid
	rm /tmp/flight.$pid
	exit
}
sam -d /tmp/flight.$pid >[2] /dev/null <<'!'
/See below/,$d
,p
!
rm /tmp/flight.$pid
# /Codeshares/,/\n\n/s/^/\n/g
 |