1 |
#!/usr/local/bin/perl -w |
#!/usr/bin/perl -w |
2 |
use strict; |
use strict; |
3 |
use File::Find; |
use File::Find; |
4 |
use Getopt::Long; |
use Getopt::Long; |
50 |
Path-Name: $path |
Path-Name: $path |
51 |
Content-Length: $size |
Content-Length: $size |
52 |
Last-Mtime: $mtime |
Last-Mtime: $mtime |
53 |
Document-Type: HTML |
Document-Type: html* |
54 |
|
|
55 |
EOF |
EOF |
56 |
print $contents; |
print $contents; |
76 |
} |
} |
77 |
close(F); |
close(F); |
78 |
|
|
79 |
|
return if (! $html); |
80 |
|
|
81 |
|
my $file_only = $path; |
82 |
|
$file_only =~ s/^.*\/([^\/]+)$/$1/g; |
83 |
|
|
84 |
my ($pre_html,$pages,$post_html) = ('<html><head><title>$path :: page ##page_nr##</title></head><body><pre>',$html,'</pre></body></html>'); |
my ($pre_html,$pages,$post_html) = ('<html><head><title>$path :: page ##page_nr##</title></head><body><pre>',$html,'</pre></body></html>'); |
85 |
|
|
86 |
($pre_html,$pages,$post_html) = ($1,$2,$3) if ($html =~ m/^(<html>.+?<pre>)(.+)(<\/pre>.+?)$/si); |
($pre_html,$pages,$post_html) = ($1,$2,$3) if ($html =~ m/^(<html>.+?<pre>)(.+)(<\/pre>.+?)$/si); |
88 |
if ($collection) { |
if ($collection) { |
89 |
$pre_html =~ s/<title>(.+?)<\/title>/<title>$collection :: page ##page_nr##<\/title>/si; |
$pre_html =~ s/<title>(.+?)<\/title>/<title>$collection :: page ##page_nr##<\/title>/si; |
90 |
} else { |
} else { |
91 |
$pre_html =~ s/<title>(.+?)<\/title>/<title>$1 :: page ##page_nr##<\/title>/si; |
$pre_html =~ s/<title>(.+?)<\/title>/<title>$1 :: page ##page_nr##<\/title>/si || |
92 |
|
$pre_html =~ s/<title><\/title>/<title>$file_only :: page ##page_nr##<\/title>/si; |
93 |
} |
} |
94 |
|
|
95 |
my $page_nr = 1; |
my $page_nr = 1; |
103 |
|
|
104 |
} else { |
} else { |
105 |
|
|
106 |
return if (! -f $path || ! m/\.html*$/i); |
return if (! -f $path || ! m/\.(html*|php|pl|txt|info|log|text)$/i); |
107 |
|
|
108 |
# skip index files |
# skip index files |
109 |
return if (m/index_[a-z]\.html*/i || m/index_symbol\.html*/i); |
return if (m/index_[a-z]\.html*/i || m/index_symbol\.html*/i); |