summaryrefslogtreecommitdiff
path: root/rc/bin/ups
blob: 6d1223d4b79674a13ac3e67cb7693bc4801058fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/rc
# ups - look up a UPS tracking number
rfork en

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

hget 'http://wwwapps.ups.com/WebTracking/processInputRequest?tracknum='^$1^ \
	'&TypeOfInquiryNumber=T' |
	htmlfmt |
	awk '/^Share/,/^Subscribe/ {print;}' |
	grep -v '^(Share|Change Delivery|Request Status Updates|Never Track Again|Continue|I am already a UPS My Choice Member|• What|Subscribe to UPS)' |
	ssam 's/\n\n\n/\n/g'