]> git.lizzy.rs Git - plan9front.git/commitdiff
remove old, broken scripts: fedex, u(s)ps, weather (thanks fulton)
authorSigrid <ftrvxmtrx@gmail.com>
Tue, 13 Apr 2021 09:26:55 +0000 (11:26 +0200)
committerSigrid <ftrvxmtrx@gmail.com>
Tue, 13 Apr 2021 09:26:55 +0000 (11:26 +0200)
rc/bin/fedex [deleted file]
rc/bin/ups [deleted file]
rc/bin/usps [deleted file]
rc/bin/weather [deleted file]
sys/man/1/fedex [deleted file]
sys/man/1/weather [deleted file]

diff --git a/rc/bin/fedex b/rc/bin/fedex
deleted file mode 100755 (executable)
index 0925f82..0000000
+++ /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 (executable)
index 0256348..0000000
+++ /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 (executable)
index ab5e489..0000000
+++ /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 (executable)
index 0f3f0a0..0000000
+++ /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 '\r' |
-sed 's/ *$//' |
-uniq |
-sed -n '/^VTEC/q; p'
diff --git a/sys/man/1/fedex b/sys/man/1/fedex
deleted file mode 100644 (file)
index 0434382..0000000
+++ /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 (file)
index a40b1f1..0000000
+++ /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.