PIKT

Samples: HTML Spell Check

PIKT Logo
Home FAQ News Intro Samples Tutorial Reference Software Authors Licensing SiteSearch

Computer Magazines at Amazon.com

Linux Journal
Linux Journal

Computer Security Journal
Computer Security Journal

Journal Of Network And Computer Applications
Journal Of Network And Computer Applications

Sys Admin
Sys Admin

Information Management & Computer Security
Information Management & Computer Security

In this example, we do an HTML spell check on PIKT web pages.

The ReportPIKTSpellingErrors script might send an alert message like the following:

-------------------------------------------------------------------------------

                                PIKT ALERT
                         Mon Jul 26 20:49:19 2004
                                 calgary

INFO:
    ReportPIKTSpellingErrors
        Report spelling errors in PIKT html files

        /var/www/html/pikt/samples/html_spell_check_alarms.cfg.html:  mssage
            The ReportPIKTSpellingErrors script might send an alert mssage
            like the following:

-------------------------------------------------------------------------------
In the ReportPIKTSpellingErrors Pikt script following, note how it uses a Perl script, spell_check.pl, for its input.

///////////////////////////////////////////////////////////////////////////////
//
// html_alarms.cfg
//
///////////////////////////////////////////////////////////////////////////////

[other alarms omitted...]

///////////////////////////////////////////////////////////////////////////////

ReportPIKTSpellingErrors

        init
                status active
                level info
                task "Report spelling errors in PIKT html files"
                input proc "for f in `find /var/www/html/pikt
                                           -name \\*.htm -print`;
                            do echo $f; /usr/local/bin/spell_check.pl -d
                            =objdir/PIKTDictionary.obj -f $f; done"

        rule
                set #isword = #false()

        rule    // determine if file or word
                if $left($inlin, 1) eq "/"
                        set $file = $inlin
                        =chomp($file, $newline())
#ifdef debug
                        output "file: $file"
#endifdef
                else
                        set $word = $inlin
                        =chomp($word, $newline())
                        set #isword = #true()
#ifdef debug
                        output "word: $word"
#endifdef
                fi

        rule    // if word, output file and word, also an
                // egrep of that word and file
                if #isword
                        output mail "$file:  $word"
                        do #popen(EGREP, "=egrep -i $word $file", "r")
                        while #read(EGREP) > 0
                                output mail $rdlin
                        endwhile
                        do #pclose(EGREP)
                fi

///////////////////////////////////////////////////////////////////////////////

[other alarms omitted...]

///////////////////////////////////////////////////////////////////////////////
This is just one program example.  You could add rules, or write new scripts, for example to:  automatically update certain web pages, report HTML coding errors, report broken links, etc.

[For more examples, see Samples.]

Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software | Authors | Licensing | SiteSearch
Links | SiteIndex | Pikt-Users | Pikt-Workers | Contribute | ContactUs | Top of Page
Page best viewed at 1024x768.   Page last updated 2005-06-22.
This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.
Copyright © 1998-2005 Robert Osterlund.  All rights reserved.

Computer Books at Amazon.com

Dynamic HTML: The Definitive Reference
Dynamic HTML: The Definitive Reference

HTML & XHTML: The Complete Reference
HTML & XHTML: The Complete Reference

HTML 4 for Dummies
HTML 4 for Dummies

The Book of Webmin
The Book of Webmin

PHP Cookbook
PHP Cookbook