From b777d3fe7d947c7bb9595aed5a571e311872b5f6 Mon Sep 17 00:00:00 2001 From: Sigrid Date: Tue, 13 Apr 2021 11:26:55 +0200 Subject: [PATCH] remove old, broken scripts: fedex, u(s)ps, weather (thanks fulton) --- rc/bin/fedex | 62 ----------------------------------------------- rc/bin/ups | 15 ------------ rc/bin/usps | 20 --------------- rc/bin/weather | 46 ----------------------------------- sys/man/1/fedex | 27 --------------------- sys/man/1/weather | 40 ------------------------------ 6 files changed, 210 deletions(-) delete mode 100755 rc/bin/fedex delete mode 100755 rc/bin/ups delete mode 100755 rc/bin/usps delete mode 100755 rc/bin/weather delete mode 100644 sys/man/1/fedex delete mode 100644 sys/man/1/weather diff --git a/rc/bin/fedex b/rc/bin/fedex deleted file mode 100755 index 0925f8283..000000000 --- a/rc/bin/fedex +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/rc - -if(! ~ $#* 1) { - echo usage: fedex 123456789012 >[1=2] - exit usage -} - -rfork e - -fn bgrep{ -pattern=`{echo $1 | sed 's;/;\\&;'} -shift - -@{ echo 'X { -$ -a - -. -} -X ,x/(.+\n)+\n/ g/'$pattern'/p' | -sam -d $* >[2]/dev/null -} -} - -fn awk2 { - awk 'NR%2==1 { a=$0; } - NR%2==0 { b=$0; printf("%-30s %s\n", a, b); } - ' $* -} - -fn awk3 { - awk '{line[NR] = $0} - END{ - i = 4; - while(i < NR){ - what=line[i++]; - when=line[i]; - comment=""; - if(!(when ~ /..\/..\/.... ..:../)){ - # out of sync - printf("%s\n", what); - continue; - } - i++; - if(!(line[i+1] ~ /..\/..\/.... ..:../) && - (i+2 > NR || line[i+2] ~ /..\/..\/.... ..:../)){ - what = what ", " line[i++]; - } - printf("%s %s\n", when, what); - } - }' $* -} - -# hget 'http://www.fedex.com/cgi-bin/track_it?airbill_list='$1'&kurrent_airbill='$1'&language=english&cntry_code=us&state=0' | -hget 'http://www.fedex.com/Tracking?action=track&language=english&cntry_code=us&initial=x&mps=y&tracknumbers='$1 | - htmlfmt >/tmp/fedex.$pid -sed -n '/Tracking number/,/^$/p' /tmp/fedex.$pid | awk2 -echo -sed -n '/Reference number/,/^$/p' /tmp/fedex.$pid | awk2 -echo -sed -n '/Date.time/,/^$/p' /tmp/fedex.$pid | sed 1,4d | fmt -l 4000 | sed 's/ [A-Z][A-Z] /&\n/g' -rm /tmp/fedex.$pid diff --git a/rc/bin/ups b/rc/bin/ups deleted file mode 100755 index 025634822..000000000 --- a/rc/bin/ups +++ /dev/null @@ -1,15 +0,0 @@ -#!/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' diff --git a/rc/bin/usps b/rc/bin/usps deleted file mode 100755 index ab5e489ad..000000000 --- a/rc/bin/usps +++ /dev/null @@ -1,20 +0,0 @@ -#!/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 | - htmlfmt > /tmp/usps.$pid - -sam -d /tmp/usps.$pid >[2] /dev/null <<'!' -,/Tracking Number:/-1d -/Available Actions/,$d -,p -! -rm /tmp/usps.$pid diff --git a/rc/bin/weather b/rc/bin/weather deleted file mode 100755 index 0f3f0a091..000000000 --- a/rc/bin/weather +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/rc - -rfork e - -DEFAULT=ewr - -fn usage{ - echo 'usage: weather 3-letter-city-code' >[1=2] - echo 'for a list of cities in new york, say' >[1=2] - echo ' weather ny' >[1=2] - exit usage -} - -switch($#*){ -case 0 - arg=$DEFAULT - if(~ $#weather 1) - arg=$weather -case 1 - arg=$1 -case * - usage -} - -switch($arg){ -case [a-zA-Z][a-zA-Z][a-zA-Z] - script=('' '' 'C' '4' '1' '1' $arg '' '' '' '' 'X') -case [a-zA-Z][a-zA-Z] - script=('' '' 'C' '4' '1' '3' $arg '' '' '' '' 'X') -case * - usage -} - -{ - for(i in $script) - echo $i -} | -con -nrl tcp!rainmaker.wunderground.com!telnet | -sed -n '/Enter .-letter .* code:/,/CITY FORECAST MENU/p' | -sed 's/Enter .-letter .* code: //' | -sed 's/ Press Return to continue, M to return to menu, X to exit: //' | -grep -v 'CITY FORECAST MENU' | -tr -d ' ' | -sed 's/ *$//' | -uniq | -sed -n '/^VTEC/q; p' diff --git a/sys/man/1/fedex b/sys/man/1/fedex deleted file mode 100644 index 0434382ec..000000000 --- a/sys/man/1/fedex +++ /dev/null @@ -1,27 +0,0 @@ -.TH FEDEX 1 -.SH NAME -fedex, ups, usps \- track shipments -.SH SYNOPSIS -.B fedex -.I tracking-number -.br -.B ups -.I tracking-number -.br -.B usps -.I tracking-number -.SH DESCRIPTION -.I Fedex -writes available shipment details for the given Federal Express 12-digit -.I tracking-number -on the standard output. -.I Ups -is similar, but takes a United Parcel Service 18-digit -.IR tracking-number . -.I Usps -takes a US Post Office -.IR tracking-number . -.SH SOURCE -.B /rc/bin -.SH BUGS -Redesigns of the source website can break these programs. diff --git a/sys/man/1/weather b/sys/man/1/weather deleted file mode 100644 index a40b1f12b..000000000 --- a/sys/man/1/weather +++ /dev/null @@ -1,40 +0,0 @@ -.TH WEATHER 1 -.SH NAME -weather \- print weather report -.SH SYNOPSIS -.B weather -[ -.I air -] [ -.I st -] -.SH DESCRIPTION -.I Weather -prints the local conditions and seven-day forecast most recently reported at the -.SM US -airport with the three-letter location identifier -.IR air . -Given a two-letter -.SM US -state abbreviation -.I st -instead, -.I weather -prints a table of -.I air -location identifiers known for -.IR st . -.PP -The arguments are mutually exclusive and case-insensitive. -If neither is given, -.I air -defaults to the value of the environment variable -.BR $weather , -or if it is unset, -to the location identifier -.BR ewr , -designating the Newark, NJ, airport near Bell Labs, Murray Hill. -.SH SOURCE -.B /rc/bin/weather -.SH BUGS -Weather is hopelessly provincial.