xref: /plan9/rc/bin/usps (revision 410ea80ba826456a91c2284e1618ccfcb1f10c78)
1#!/bin/rc
2rfork en
3
4
5if(! ~ $#* 1) {
6	echo usage: usps 01601531218002685498 >[1=2]
7	exit usage
8}
9
10rfork e
11
12hget -p 'origTrackNum='^$1 http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do |
13	htmlfmt > /tmp/usps.$pid
14
15sam -d /tmp/usps.$pid >[2] /dev/null <<'!'
160,/Label/-1d
17/^Enter Label/,$d
18,p
19!
20rm /tmp/usps.$pid
21