/[suikacvs]/markup/h2h/implementation/classic/h2h-diary.pl
Suika

Contents of /markup/h2h/implementation/classic/h2h-diary.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sat Jul 19 12:46:44 2003 UTC (21 years, 4 months ago) by wakaba
Branch: MAIN
File MIME type: text/plain
Imported to CVS

1 wakaba 1.1
2     #$H2H::themepath = '/home/local/h2h/H2H/';
3     require H2H;
4     #require $H2H::themepath.'default/theme.ph';
5    
6     my %O;
7     ($O{y}, $O{m}, $O{path}) = @ARGV;
8    
9     unless ($O{y}) {
10     (undef, undef, undef, undef, $O{m}, $O{y}) = localtime; $O{m}++;
11     $rev = 1;
12     }
13     $O{y} += 1900 if $O{y} < 1000;
14     $O{m} = substr('0'.$O{m}, -2);
15     $O{path} = $O{path} || '\\home\\local\\d\\'.$O{y}.'\\';
16    
17     my $basepath = $O{path};
18     #$hnffiles = 'd'.$O{y}.$O{m}.'??.hnf';
19     my $hnffiles = qr/^d$O{y}$O{m}(?:[0-9][0-9])\.hnf$/;
20     my $output_filename = '\\home\\suika\\public_html\\d\\d'.$O{y}.$O{m}.'.ja.html';
21    
22     #open A, '| dir /B '.$basepath.$hnffiles.' > .filelist.txt'; close A;
23     #open D, '.filelist.txt'; @FILELIST = <D>; close D;
24     opendir DIR, $basepath;
25     my @FILELIST = (grep(/$hnffiles/, readdir(DIR)));
26     close DIR;
27    
28     if ($rev) {@FILELIST = sort {$b cmp $a} @FILELIST}
29     else {@FILELIST = sort {$a cmp $b} @FILELIST}
30    
31     my $output;
32    
33     my %boptions = (
34     directory => 'H2H/V100/Theme/', theme => 'Fuyubi',
35     theme09_directory => '/home/local/h2h/H2H/V090/',
36     theme09 => 'default',
37     title => '冬様もすなる☆日記というもの',
38     year => $O{y}, month => $O{m}+0,
39     );
40     for $fn (@FILELIST) {
41     my %options = (%boptions);
42     $fn =~ tr/\x0D\x0A//d;
43     if ($fn =~ /(\d{4})(\d\d)(\d\d)/) {
44     ($options{year},$options{month},$options{day}) = ($1,$2+0,$3+0)}
45     elsif ($fn =~ /^(.+)\.hnf$/) {$options{prefix} = $1}
46     if (-e $basepath.'.title'){open T,$basepath.'.title';$options{title}='';
47     while(<T>) {$options{title} .= $_} close T}
48     $options{noheader} = 1; $options{nofooter} = 1;
49     open HNF, $basepath.$fn;
50     $output .= H2H->toHTML(\%options, <HNF>);
51     close HNF;
52     }
53    
54     if ($output) {
55     require '/home/suika/lib/jcode.pl';
56     $boptions{version} = 'H2H/1.0';
57     $output = H2H->header(\%boptions).$output.
58     H2H->footer(\%boptions);
59     #my $s = &H2H::Page::start($title).$output.&H2H::Page::end($title);
60     jcode::convert(\$output, 'jis', 'euc');
61     open HTML, '> '.$output_filename; binmode HTML;
62     print HTML $output;
63     close HTML;
64     }
65    
66     1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24