USGS Programs and Scripts


Table of Contents
HTML Authoring Tools
Link Editors
Convert one or more html documents to a postscript file
Generic Feedback Form
Display number of times each link on a page has been taken
Log Analysis
Extract one month from log file
h2o.cgi Site Parsing
US Imagemap of States
Self-expiring "New" icons
Include bits of html from other documents on your site
Req - Email or Web based request tracking system
Process a Form

HTML Authoring Tools

The links here are to distribution software that should be available on all the Water Resources servers. Includes info on programs, utilities, man page links and more!

Tools to Assist the WWW Author

Link Editors

linkrel.pl

Changes, where possible, full URL's to relative URL's.
Updated: 31 Oct 2003

Perl code || Documentation

linkabs.pl

Changes all relative URL's to full URL's.
Updated: [an error occurred while processing this directive]

Perl code || Documentation


Conversion

Convert one or more html documents to a postscript file

A 10 step process for using Unix Netscape and Acrobat Distiller (part of FrameMaker 5.x) to produce a Postscript or PDF file containing one or more web pages

A method for generating a PostScript version of a set of Web pages


Log Analysis

enuml

Show how often links on a web pages are used, by creating a copy of an html document where each local link is labeled with the number of times that link has been used (an example). For a list of options type the command name with no options.

Perl code temporarily unavailable (contact David Boldt for Info).

log_profile.pl

This is the program that provides the statistics seen from <http://water.usgs.gov/server_stats/>;. The analysis is designed to determine who is using your server and what pages they are looking at.

Current Version is 6.0 02Dec1999. This version is faster and uses improved time computations.
Updated: 09 Jul 2001

Perl code | Documentation

extract_monthly_log.pl

This program extracts a month's data from one or more log files. It is useful for managing your logs, and can be combined with log_profile.pl.
Updated: 09 Jul 2001

Perl code | Documentation

h2o.cgi Site parsing

h2o.cgi, which is running on the h2o server allows you to, among other things:

See documentation for links to programs.


US Imagemap of States

map This is the imagemap or the U.S. seen on many of the WRD pages. It comes as a compressed tar file containing the image as a .gif file and the .imf imagemap file. The .imf file can be modified with a text editor to fit a particular application. A README file is included with complete instructions.

Tar file


A Server-Side Include Program for Self-Expiring "New" Icons

wasnew

Below is a sample use of wasnew
<!--#exec cmd="/home/www/ssi/wasnew June 17, 1998"-->

The program rotates through three icons of decreasing vividness after 1 week, 2 weeks, and 4 weeks respectively. After 4 weeks no image is displayed. The icons and times are configurable in the perl program. See the included README file for details. This program has also been written in to the h2o.cgi family of tools

gzipped tar file


Include bits of html from other documents on your site

classgrep

The classgrep program can be used as a server-side include to pull bits of html from other documents on your site. The bit of html that you wish to extract must be tagged with an html 4.0 class. A DIV tag, with an associated class, can be used to surround the text that you wish to be able to extract. This program has also been written in to the h2o.cgi family of tools, which also documents classgrep.

perl code


Send html form results to an email address

decode.pl

If the action for a form is set to
<form method="post" action="mailto:email_id@usgs.gov">,
the contents of the filled out form will be sent to the given email address. The email message will contain a specially encoded format of the form information, which can be decoded using the decode.pl program.

perl code


Request Tracking System

Req is a free email request tracking system which had a perl based web interface designed for it. Read the article "A Free Problem-Tracking Program Gets a New Look" in the April 98 issue of the magazine WebTechniques to find the code and background.


Process a Form

process_form

On Web server water.usgs.gov a tool for automatically processing forms in a generic way has been installed. This Perl script can send a result of any form in e-mail, and/or save it to file. For instructions, go to: http://water.usgs.gov/cgi-bin/process_form. The help is a bit short and cryptic; You need to post the form to the URL given above, and you can set hidden variables to control how the form is processed and what to do with the results.

perl code for CGI and associated library


Water http://water.usgs.gov/ WRD internal http://water.usgs.gov/usgs/ WWW ../www.html