procmail
[Top] [All Lists]

Re: HTML mailer bouncing

1997-10-05 11:32:10
| Fri 97-10-03 Kimmo Jaskari <kimmo(_at_)alcom(_dot_)aland(_dot_)fi> 
list.procmail

[Html to text converter]

Here is one elegant perl code that does the formatting. I have
kept it around long time. I have no ide if the http is valid, but...

#   ftp://ftp.sunet.se/pub/unix/utilities/glimpse/html2txt
#
# converts html files into ascii by just stripping anything between
#  < and >
# written 4/21/96 by Michael Smith for WebGlimpse

$carry=0;

while(<>){
        $line = $_;

        if($carry==1){
                # remove all until the first >
                next if($line!~s/[^>]*>//);
                # if we didn't do next, it succeeded -- reset carry
                $carry=0;
        }

        while($line=~s/<[^>]*>//g){};
        if($line=~s/<.*$//){
                $carry=1;
        }
        print $line;
}



<Prev in Thread] Current Thread [Next in Thread>