From e437b7f33312b1c3dd93f6350b7a7c94a10a2b63 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 1 Jan 2011 13:51:50 +0000 Subject: [PATCH] Stop tracking a third-party program. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@297 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- hotexplode.pl | 186 -------------------------------------------------- 1 file changed, 186 deletions(-) delete mode 100755 hotexplode.pl diff --git a/hotexplode.pl b/hotexplode.pl deleted file mode 100755 index 8cf2dd4..0000000 --- a/hotexplode.pl +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/perl - -# hotexplode -- a program for "exploding" a xmosaic hotlist or Netscape -# bookmark file into a hierarchial multi-page structure. -# acb 60 Chs 3162 - -# revision history: -# v1.0: 1-3-1996: initial version - -$date = `date`; - -# customise below - -# header: some arbitrary HTML text which is appended below the title and -# above the hotlist data - -$header = < -
-This hotlist was generated with -hotexplode -on $date. -

-WARNING: 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. -

-
-
-Please DO NOT bookmark this page. Bookmark the -main page instead. -Any other page in the hierarchy can be renamed, moved or removed at any time. -
-FOO - -$footer = < -FOO - -# which directory shall contain the hotlist? - -$outdir = "hotlist"; - - -# end of customisable portion - -require "getopts.pl"; - -&Getopts("o:t:v"); - -$outdir = $opt_o if $opt_o; - - -# seek forward to the title -while (<>) { - if (/([^\<\>]*)<\/TITLE>/) { - $title = $1; - last; - } -} - -$title = $opt_t if $opt_t; - -# seek forward to the start of the list - - -while (<>) { - 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 an xmosaic hotlist -# exit when we meet a </UL> -# arguments: pathname of directory in which output is to be placed, -# title - -sub parse_mosaic_hotlist { - # 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>\ -<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=koi8-r\">\ -<TITLE>$title\ -\ -\n

$title

\n $header \n
\n
    "; - - warn "Creating $prefix...\n" if $opt_v; - - # create the directory, if needed - mkdir($prefix, 0755) unless -d $prefix; - - while (<>) { - last if (/<\/UL>/); - - if(/
  • *]*>([^\<]*)<\/A>/) { - # - # A URL - # - local($url,$name) = ($1, $2); - $result = $result."
  • $name \n"; - next; - } - if(/
  • (.*)$/) { - # - # we've got a live one here... - # - local($subtitle)=local($filename)=$1; - $filename =~ tr/0-9A-Za-z//cd; - $filename =~ tr/A-Z/a-z/; - <>; # eat the "
      " line. - $result .= "
    • ${subtitle}\n"; - &parse_mosaic_hotlist("${prefix}/${filename}", "${title}:${subtitle}"); - next; - } - - } - - $result = $result . $footer . ""; - # write it to a file - open(FILE, ">${prefix}/index.html"); - print FILE $result; - close(FILE); -} - -# parse a Netscape bookmarks list -# exit when we meet a -# arguments: pathname of directory in which output is to be placed, -# subtitle - -sub parse_netscape_bookmarks { - # 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) = "\ -\ -$title\ -\ -\n

      $title

      \n $header \n
      \n
      "; - - warn "Creating $prefix...\n" if $opt_v; - - # create the directory, if needed - mkdir($prefix, 0755) unless -d $prefix; - - while (<>) { - last if (/<\/DL>/); - if (/
      ]*>([^\<]*)<\/H3>/) { - # - # a nested list - # - local($subtitle)=$1; - local($filename)=$1; - $filename =~ tr/0-9A-Za-z//cd; - $filename =~ tr/A-Z/a-z/; - # parse the description here - local($desc)=""; - while(<>) { - last if (/
      /); - $desc = $desc . $_; - } - $result = $result . "
      ${subtitle}\n"; - unless("$desc" eq "") { $result = $result . $desc; } - &parse_netscape_bookmarks("${prefix}/${filename}", - "${title}:${subtitle}"); - next; - } - if (/
      ]*>([^\<]*)<\/A>/) { - # - # A URL - # - local($url, $name) = ($1, $2); - $result = $result."
      $name \n"; - next; - } - $result = $result . $_; - } - $result = $result . $footer . ""; - # write it to a file - open(FILE, ">${prefix}/index.html"); - print FILE $result; - close(FILE); -} - - -- 2.39.2