#!/bin/sh # # A Hypertext Archie Gateway for the CGI interface of an httpd deamon # # Version 1.2 21 Jan 94 # # This script relies on the C-archie client from Brendan Kehoe # Once installed, please set the correct path below. # You can obtain the latest version from a comp.sources archive, or at # file://ftp.uu.net/networking/info-service/archie/clients # # QUERIES # # An accompanying HTML Form sets up the query and allows all the functionality # of c-archie to be set explicitly. # # For clients without form support the script can be called without arguments, # resulting in an ISINDEX page. Reasonable defaults are taken # for each option. A pointer to the script without arguments is included in # the form header. # # The accompanying Form relies heavilly on Martijn Koster's ArchiePlex Form. # Infact it will probably work with that too. # # HYPERTEXT RESULTS # # The main point of providing this script is infact to format the Archie # results into Hypertext. This is acheived with a bit of awk script. # Hypertext links point to the files and directories listed by archie. # One click and you've got what was asked for ! # Mosaic's internal icons are used for file and directory pointers, a # textual alternative is provided for browsers without. # # INSTALLATION (very easy !) # # 1. Install C-archie (see above for suggested sources) # 2. Edit the line in AA describing the location of C archie # 3. Put AA in your servers cgi-bin. # 4. Put AA.html in your htdocs tree, and away you go... # # You might like to edit some of the defaults in AA, such as the server for # non-forms based queries. See DEFAULT_SERVER and others below. # # PORTING NOTES # # This script should work on almost all systems with a bourne shell, awk and # c-archie. Try the gnu utilities gawk and bash on non-unix machines # (NB I've not tried this). # # I've used it sucessfully on Sillicon Graphics machines running IRIX 4 but.. # #Ultrix # # set the first line to be #!/bin/sh5 otherwise the [ dosn't function correctly. # # # Acknowledgements # # Thanks to Martijn Koster for his ArchiePlex interface. It was the # inspiration for me to provide one for NCSA's httpd. I used his HTML form # as the bsis for this script. # Thanks also to Brendan Kehoe for his archie client, that was # quite straightforward to HyperTextualise (a new word ?) # # Thanks for the comments from the following people that brought version 1.1 # JQ Johnson, Simon Poole, Paul Harrington. # # Enjoy ! # # Guy Brooker # guy@jw.estec.esa.nl # # 21/01/94 # # Modifications # # Version 1.0 # 19/12/93 Guy Brooker # # Version 1.1 # 07/01/94 Guy Brooker # o Dangerous Security Hole Removed. For a non-forms based query # QUERY_STRING was assigned query=$*. This enabled malicious # queries such as `cat Observation Results for $QS_station

Observations at $QS_station for $QS_time


EOM echo '
'
	$WEATHER -c $OPT_prog $QS_station $OPT_time | ./clean
	echo '
' echo '' else # #.. The script was called without a query. # Provide an ISINDEX type response for browsers # without form support. # cat << EOM Content-type: text/html Current Observation Search

Current Observation Search


Enter Station Name

A station name is a three letter identifier for an airport or a weather station. One example is "roc" for Rochester, New York. If you want a state wide search, enter "@NY", where the NY is a two letter ID of a state (NY is New York).

Enter Time Option

Decoding of Data?

Raw Partial Full

A raw decode gives the observations in SA format. If you are not familiar with this format (most pilots and meteorologists are) then use a partial or full decode option to turn the observations into readable english text

Press Here when Finished

EOM fi else # # Brendan Kehoe's Archie Client was not found # Report a useful message # cat << EOM Content-type: text/html WX Program not found

WX Program not found

don@weather.brockport.edu
EOM fi