summaryrefslogtreecommitdiff
path: root/rc/bin/usps
blob: 7c7cf19211fd3e50483ee63cb7ee51e7a8a4c39c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/rc
rfork en


if(! ~ $#* 1) {
	echo usage: usps 01601531218002685498 >[1=2]
	exit usage
}

rfork e

hget -p 'origTrackNum='^$1 http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do |
	htmlfmt > /tmp/usps.$pid

sam -d /tmp/usps.$pid >[2] /dev/null <<'!'
0,/Label/-1d
/^Enter Label/,$d
,p
!
rm /tmp/usps.$pid