elements, but \n");
} else {
&write_html(" \n");
}
}
&inc_indent;
my $has_entries = 0;
while ($line ne "-") {
$line = get_next_line;
SWITCH: {
if ($line eq "#FOLDER") {
&parse_folder;
$has_entries = 1;
last SWITCH;
}
if ($line eq "#URL") {
&parse_url;
$has_entries = 1;
}
if ($line eq "#SEPERATOR") {
&parse_seperator;
}
}
}
if ($has_entries == 0)
{
if (!$MOZILLA) {
&write_html (" \n");
}
} # from the Extra Folders if...else
}
sub ico_to_uri ($)
{
my $input = shift;
$input =~ s/\....\Z//;
return "http://$input/favicon.ico";
}
sub parse_url {
my (%bookmark, $line, $name, $value);
$line = get_next_line;
$bookmark{"DESCRIPTION"}="";
$bookmark{"URL"}="";
$bookmark{"NAME"}="";
$bookmark{"ICONFILE"}="";
$bookmark{"CREATED"}="";
$bookmark{""}="";
# if ($bookmark {"URL"} =~ /$EXCLUDE_URI/ && $PRINT_THIS) {
# $PRINT_THIS = 0;}
while ($line ne "") {
if ($line =~ /=/) {
($name, $value) = split(/=/, $line,2);
$bookmark{$name} = $value;
}
$line = get_next_line;
}
$bookmark{"NAME"} = &encode_html ($bookmark{"NAME"});
$bookmark{"URL"} = &encode_html ($bookmark{"URL"});
if (!$MOZILLA) {
&write_html(" Synced with Opera Hotlist at: " .$time .". \n");}
&parse;
if (!$MOZILLA) {
&write_html(" \n");}
if (!$MOZILLA) {
&write_html("$myhr\n");
&write_html(" \n");
if (!$UNSORT_FOLDERS) {
@folders = sort { (lc$a) cmp lc($b) } @folders;
}
foreach my $folder (@folders){
my $folderid = &encode_folderid($folder);
&write_html("[$folder]\n");
}
&write_html(" Synced with Opera Hotlist at: " .$time .".
# - a clumsy attempt to prevent these ID values from starting with anything but a-Z
# - no inline styles or deprecated attributes, only class names
# - as a result, some extra rules are needed in the CSS file to get a really nice layout
# - added a validate CSS button
#
# - added option 'nodateontop', which prevents the printing of the date stamp on top
#
# See his hotlist:
# http://people.opera.com/rijk/opera/hl/hotlist.html
#
# Revision 2.11 2003/07/02 21:50:07 alanh
# BUGFIX: -x, --exclude-folder work for subfolders!
# -x, --exclude-folder now uses a regex!
# Changed exclusion of special folders (Trash, Find Results)to use regex.
# Deprecated --exclude in favor of --exclude-folder
# Removed --delimiter command line option (generates warning)
# Added comments to variable names
#
# Revision 2.10 2003/07/01 14:14:01 alanh
# Now includes description field in output (both regular and mozilla)
# --descr-sep can modify the description separation HTML (default &mdash)
# Changed folder names to not be 's, but the and links use _'s.
# Renamed %attrib to %folder in parse_folder.
#
# Revision 2.9 2003/06/11 15:05:37 alanh
# Now works on Windows hotlists without needing things like unix2dos.
# Folder names now use _ instead of spaces in the
# (makes it possible to link directly to a folder from another place)
#
# Revision 2.8 2003/06/10 20:10:59 alanh
# Changed spaces in folder names/links to 's
#
# Revision 2.7 2003/04/14 16:03:39 alanh
# Version number now in a nicer format, but still autogenerated
# Ignore list partially works, but is still buggy (no sub-folders)
# Added -v, --version option
# Added ability to suppress warning messages (-q, --quiet)
# 'Trash' bookmark folder excluded by default (include with --include-extra-folders)
# renamed --include-find-results to --include-extra-foldersAdded more comments.
# Tested with Opera 7 bookmarks (works!)
# Reorganized code (e.g. moved -h code to a better place)
# Added more comments.
#
# Revision 2.6 2003/02/25 13:01:36 alanh
# Added ability to include dates into Mozilla hotlists.
# Added utf-8 encoding to the html headers
# (fixes display on Konquorer, Mozilla, and allows better import into Mozilla)
# Removed "Find Results" folder from default output.
# (will later expand to have an "Ignore" list)
# Added --include-find-results command line option
#
# Revision 2.5 2003/02/21 16:15:06 alanh
# added folder list sorting the default
# added --unsort-folder-list command-line option
# added and corrected command line help
# removed older 1.x log entries
#
# Revision 2.5 2003/02/21 16:09:21 alanh
# added folder list sorting the default
# added --unsort-folder-list command-line option
# added and corrected command line help
#
# Revision 2.4 2003/02/21 15:29:09 alanh
# Mozilla bookmark file output.
#
# Revision 2.3 2003/02/20 17:59:18 alanh
# renamed without .pl
# updated help to be more accurate
#
# Revision 2.2 2003/02/19 15:44:18 alanh
# fixed typographical error in help text
#
# Revision 2.1 2003/02/19 05:26:06 alanh
# New version
# added command line options.
# unified with myophotlist2html
#
use Time::Local;
use strict;
use Getopt::Long;
'$Revision: 2.15 $' =~ m/\d+\.\d+/;
my $VERSION = $&;
# The following $def* variables are used to get around the GetOptions
# input. They are used to keep output from being inaccurate if
# erroneous options are included with --help
my $defhr = '
';
my $defheader ='My Opera Hotlist
';
my $deftitle = 'My Opera Hotlist';
my $myheader = $defheader; # the of the HTML output
my $mytitle = $deftitle; # the " .$folder{"NAME"} );
if ($folder{"DESCRIPTION"}) {
&write_html_noformat($DESCR_SEP ."".$folder{"DESCRIPTION"}.
"");}
&write_html_noformat("
\n");
&write_html("\n");
} else {
if (!$INCLUDE_DATES) {
&write_html("
\n");
} else {
&write_html("" .$folder{"NAME"} ."
"
.$folder{"NAME"} ."
Bookmarks
\n");
}
&write_html("\n");
&inc_indent;
if (!$MOZILLA) {
&write_html("\n");
&inc_indent;
&write_html("\n");}
else {
&write_html("
\n");}
else {
&write_html("Folder list:
\n");
&write_html("
\n");
&write_html("Generated with OperaHotlist2html $VERSION