#!/usr/bin/perl
# Adaptiert von Grisus heise.pl

use strict;
use diagnostics;

my $flag = 0;
my $sztext="";
my $sztext2="";

while (<>) {
    chomp;
    if ( ! $flag ) {
	if ( /<!-- beginn content -->/ || ?<!-- /Infothek -->? ) { 
	    $flag = 1;
	    next ;
	}
    }
    if ( $flag == 1 ) {
	if ( /<br class=.*>/ ) { $flag = 2; next ; }
    }
    if ( $flag == 2 ) {
	if ( /<p class=\"b11[^>]+>(.*)<\/p>/ ) { 
	   $flag = 3;
           $sztext .= "$1: ";
	   next ; 
	}
    }
    if ( $flag == 3 ) {
	if ( /<p class=\"b15[^>]+>(.*)<\/p>/ ) { 
	   $flag = 4;
           $sztext .= "$1";
	   next ; 
	}
    }
    if ( $flag == 4 ) {
	if ( /<!-- ende content -->/ ) {
	    $flag = 0;
	    last ;
	} 
	if ( /<!--banner Middle3 -->/ ) {
	    $flag = 0;
	    last ;
	} else {
#            if ( /\(SZ vom [0-9]+\.[0-9]+\.[0-9]+\)/ ) { 
#	       $sztext .= "$1";
#               last ; 
#            }
	    $sztext .= "$_\n";
	}
    }
}

print "<html><body>" . $sztext . "</body></html>\n";
