]>
pere.pagekite.me Git - homepage.git/blob - gildet98/generate-page.pl
3 # Genererer program-rĂ¥data utfra HTP-filer
5 ($felt, $test) = $ARGV[0] =~ m/(.+)=(.*)/;
9 chdir $dir || die "Unable to find $dir";
13 %info = parse_htp
($file);
15 if ($info{$felt} eq $test) {
17 $url =~ s/\.htp$/.html/;
18 $hendelse{"$info{dato}\t$info{tid}\t$url"} = $info{'tittel'};
23 print "<SET tittel=\"Program $test\">\n";
24 print "<SET type=\"program\">\n";
25 print "<BLOCK artikkel>\n";
26 print "<DL compact=\"compact\">\n";
29 for $key (sort keys %hendelse) {
30 ($dato, $tid, $file) = split(/\t/, $key);
32 if ($dato != $test && $sistedato ne $dato) {
33 print "<DT><STRONG>$dato</STRONG></DT>\n";
36 print "<DT>$tid<DD><A HREF=\"$file\">$hendelse{$key}</A>\n";
38 print "</DL>\n</BLOCK>\n";
42 warn "Bad or missing '<SET dato=\"\">'"
43 if (! ($info{'dato'} =~ m/^\d\d\d\d-\d\d-\d\d$/) );
51 open(HTP
, "<$filename") || die "Unable to open $filename for reading";
53 ($key, $val) = m/<set (.*)=\"(.*)\">/i;
54 $info{$key} = $val if ($key);