def start_title(self, attrs):
def start_title(self, attrs):
+ if DEFAULT_CHARSET:
+ self.accumulator += '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=%s">\n' % DEFAULT_CHARSET
self.accumulator += "<TITLE>"
def end_title(self):
self.accumulator += "<TITLE>"
def end_title(self):
-# hotexplode -- a program for "exploding" a xmosaic hotlist or Netscape
+# hotexplode -- a program for "exploding" a xmosaic hotlist or Netscape
# bookmark file into a hierarchial multi-page structure.
# acb 60 Chs 3162
# bookmark file into a hierarchial multi-page structure.
# acb 60 Chs 3162
-# header: some arbitrary HTML text which is appended below the title and
+# header: some arbitrary HTML text which is appended below the title and
# above the hotlist data
$header = <<FOO;
<hr width="50%">
<blockquote>
# above the hotlist data
$header = <<FOO;
<hr width="50%">
<blockquote>
-This hotlist was generated with
+This hotlist was generated with
<a href="http://www.zikzak.net/~acb/hacks/hotexplode.html">hotexplode</a>
on $date.
<p>
<a href="http://www.zikzak.net/~acb/hacks/hotexplode.html">hotexplode</a>
on $date.
<p>
-<b>WARNING:</b> The inclusion of a link to a page on
-this hotlist is not an indication of the maintainer's
+<b>WARNING:</b> The inclusion of a link to a page on
+this hotlist is not an indication of the maintainer's
approval of or agreement with its content.
</blockquote>
<hr width="50%">
approval of or agreement with its content.
</blockquote>
<hr width="50%">
- if(/<UL>/) { warn "Detected xmosaic hotlist format\n" if $opt_v;
+ if(/<UL>/) { warn "Detected xmosaic hotlist format\n" if $opt_v;
&parse_mosaic_hotlist($outdir, $title); last; }
if(/<DL>/) { warn "Detected Netscape bookmark format\n" if $opt_v;
&parse_netscape_bookmarks($outdir, $title); last; }
&parse_mosaic_hotlist($outdir, $title); last; }
if(/<DL>/) { warn "Detected Netscape bookmark format\n" if $opt_v;
&parse_netscape_bookmarks($outdir, $title); last; }
# we write the file at the very end, because (I think) filehandles do
# not have local scope, and this is recursive
local($prefix, $title) = @_;
# we write the file at the very end, because (I think) filehandles do
# not have local scope, and this is recursive
local($prefix, $title) = @_;
- local($result) = "<HTML><HEAD><TITLE>$title </TITLE></HEAD>\
-<BODY>\n<CENTER><H1>$title </H1></CENTER>\n $header \n<hr>\n<ul>";
+ local($result) = "<HTML><HEAD>\
+<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=koi8-r\">\
+<TITLE>$title</TITLE>\
+</HEAD>\
+<BODY>\n<CENTER><H1>$title</H1></CENTER>\n $header \n<hr>\n<ul>";
warn "Creating $prefix...\n" if $opt_v;
warn "Creating $prefix...\n" if $opt_v;
# create the directory, if needed
mkdir($prefix, 0755) unless -d $prefix;
# create the directory, if needed
mkdir($prefix, 0755) unless -d $prefix;
&parse_mosaic_hotlist("${prefix}/${filename}", "${title}:${subtitle}");
next;
}
&parse_mosaic_hotlist("${prefix}/${filename}", "${title}:${subtitle}");
next;
}
}
$result = $result . $footer . "</body></html>";
}
$result = $result . $footer . "</body></html>";
# we write the file at the very end, because (I think) filehandles do
# not have local scope, and this is recursive
local($prefix, $title) = @_;
# we write the file at the very end, because (I think) filehandles do
# not have local scope, and this is recursive
local($prefix, $title) = @_;
- local($result) = "<HTML><HEAD><TITLE>$title </TITLE></HEAD>\
-<BODY>\n<CENTER><H1>$title </H1></CENTER>\n $header \n<hr>\n<dl>";
+ local($result) = "<HTML><HEAD>\
+<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=koi8-r\">\
+<TITLE>$title</TITLE>\
+</HEAD>\
+<BODY>\n<CENTER><H1>$title</H1></CENTER>\n $header \n<hr>\n<dl>";
warn "Creating $prefix...\n" if $opt_v;
warn "Creating $prefix...\n" if $opt_v;
# create the directory, if needed
mkdir($prefix, 0755) unless -d $prefix;
# create the directory, if needed
mkdir($prefix, 0755) unless -d $prefix;
# a nested list
#
local($subtitle)=$1;
# a nested list
#
local($subtitle)=$1;
$filename =~ tr/0-9A-Za-z//cd;
$filename =~ tr/A-Z/a-z/;
# parse the description here
$filename =~ tr/0-9A-Za-z//cd;
$filename =~ tr/A-Z/a-z/;
# parse the description here
}
$result = $result . "<dt><b><a href=\"${filename}/index.html\">${subtitle}</a></b>\n";
unless("$desc" eq "") { $result = $result . $desc; }
}
$result = $result . "<dt><b><a href=\"${filename}/index.html\">${subtitle}</a></b>\n";
unless("$desc" eq "") { $result = $result . $desc; }
- &parse_netscape_bookmarks("${prefix}/${filename}",
+ &parse_netscape_bookmarks("${prefix}/${filename}",
"${title}:${subtitle}");
next;
}
"${title}:${subtitle}");
next;
}