Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Sunday, July 13, 2025

File: [Platon] / scripts / shell / votemail / functions.awk (download)

Revision 1.1, Tue Feb 5 14:00:03 2002 UTC (23 years, 5 months ago) by host8

Scripts for catching spam and spamers.

# Function for skipping header
function skip_header()
{
    do 
        getline txt ;
    while ( length(txt) > 0 ) 
    
    return
}

# First skip header
BEGIN {
    skip_header()
    reply_lines = 0;
    new_lines   = 0;
    empty_lines = 0;
    replies     = 0;
    signatures  = 0;
}

END {
    print "Reply lines: " reply_lines;
    print "New   lines: " new_lines;
    print "Empty lines: " empty_lines;
    print "Replies    : " replies;
    print "Signatures : " signatures;
}

# Empty lines
/^$/ {
    empty_lines++;
    next;
}

# Reply to somebody
#On Wed, Jan 23, 2002 at 10:18:27AM +0100, klokan wrote:
/^On \(Mon|Tue|Wed|Thu|Fri|Sat|Sun\)\(.*\) wrote:$/ {
    replies++;
    next;
}

# Text in reply
/^> / {
    reply_lines++;
    next;
}

# Counter for signatures from haluze
/http:\/\/www\.Haluze\.sk/ {
    signatures++;
    next;
}

# Normal text
{
    new_lines++;
#    print NR "    " $0
    next;
}

# vim: set autoindent

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top