plan9fox/rc/bin/usps
2013-10-15 15:47:56 -04:00

20 lines
327 B
Bash
Executable file

#!/bin/rc
rfork en
if(! ~ $#* 1) {
echo usage: usps 01601531218002685498 >[1=2]
exit usage
}
rfork e
hget -p 'qtc_tLabels1='^$1 https://tools.usps.com/go/TrackConfirmAction |
uhtml | htmlfmt > /tmp/usps.$pid
sam -d /tmp/usps.$pid >[2] /dev/null <<'!'
,/Tracking Number/-1d
/Available Options/,$d
,p
!
rm /tmp/usps.$pid