Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/ups-update/ups

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

rfork en

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

hget 'http://wwwapps.ups.com/WebTracking/processInputRequest?tracknum='^$1^ \
	'&TypeOfInquiryNumber=T' >/tmp/ups.1

sed 's/<[Tt][Dd]>/& «TD»/g; s/<[Tt][Rr]>/&<td> «TR» /g' /tmp/ups.1 |
	htmlfmt >/tmp/ups.2
sam -d /tmp/ups.2 >[2] /dev/null <<'!'
/^Tracking results.*/p
.,$d
/Help/d
1,.d
$-2,$d
/Status:/+1
.,/«TR»/-2d
,s/\n/ /g
,s/«TR»/\n/g
,s/«TD»/	/g
,s/ *	 */	/g
,s/^[ 	]*//g
,s/[ 	]*$//g
,s/\n\n+/\n\n/g
,p
!
echo

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.