Re: Prelude to removing duplicated bookmarks

2018-09-09 Thread Richard Owlett

On 09/09/2018 01:28 PM, sean wrote:

Richard Owlett wrote:

My bookmarks have grown like Topsy.
[ I've > 300 folders and >5000 bookmarks ]
I have many duplicates and the tree structure is a mess.
My goals include:
   1. Create a HTML file of bookmarks which:
  a. clearly shows the hierarchical structure of nested folders.
  b. allows searching for folder names as well as page titles.
  c. clearly shows in which the searched for file resides.
   2. find and purge duplicates.
   3. move folders around to create a more reasonable structure.

Looking for useful tools I found jq [https://stedolan.github.io/jq/].

An outline of my procedure is:
  1. export SeaMonkey bookmarks in JSON format.
  2. use jq to pretty print the JSON. {It does so nicely.}
  3. create HTML file described above.
  4. find duplicate targets and delete all but one.
  5. Each leaf of the bookmark tree is an object.
 Move these objects around to create a more friendly tree.
  6. Import the clean organized bookmarks.

The Tcl code below does #3. I've only sketched how to do #4.
[requires having done
 jq '.' yourrawbookmarks.json > prettytestalpha.json
]

Comments?





# Input is SeaMonkey bookmark file pretty printed with "jq"

set infile  "prettytestalpha.json"
set outfile "alphatest.html"

set fd_in  [open $infile  r]
set fd_out  [open $outfile w]

# set predefined values
set children    "\"child"
set uri    "\"uri\":"
set title    "\"title"
set rbracket    \]
set mylist [list $children $title $uri $rbracket]

# to be used at start of page of HTML
set preface {

PREalpha pretty bookmarks


PREalpha pretty bookmarks
}
set postlude {
}


# a reminder of how to format a clickable link
# $title


set myline    0
set outline 0
set indent ""
set plusindent " "
set sth1 ""
set enh1 ""
set aheading 0    ;# used to flag if $title is section label 
when =1


puts $fd_out $preface
while { ! [eof $fd_in] } {
   incr line
   gets $fd_in b_line
   set a_line [string trimleft $b_line]
   set c_line [string range $a_line 0 5]

   set x  [lsearch $mylist $c_line]
   if { ($x >= 0) } then {

 switch $x {
   0 {set indent $indent$plusindent; set aheading 1;}
   1 {set a_line [string replace $a_line 0 9];
  set a_line [string replace $a_line end-1 end];
  set title $a_line;
  if $aheading then {puts $fd_out "$sth1$indent$a_line$enh1";
  set aheading 0; incr myline}}
   2 {set a_line [string replace $a_line 0 6];
puts $fd_out "$indent  $title";
incr outline }
   3 {set indent [string replace $indent end-4 end];}
   }
  }
}


puts $fd_out "There are $myline folders"
puts $fd_out "There are $outline bookmarks"

puts $fd_out $postlude
close $fd_in
close $fd_out



Posting in this thread as it's gonna prove to be quite useful... and to 
help me locate it again when I have more time...


Do you make use of mail/newsgroups tags?
I have ~40.
Most are project related.
One outlier has an interesting title -- "odd topics".



"A file that big?
   It might be very useful.
     But now it is gone."


I frequently advise backups.
Q. Do I?
A. 5th amendment ;/



from: http://www.thezensite.com/non_Zen/haiku_for_windows.html


IIUC, Murphy more concise ;/

BTW If successful I'll attempt to do something similar for email/Usenet.

If you old enough -- 1 ram 1 kilowatt dam >?? ooops 





___
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey


Re: Prelude to removing duplicated bookmarks

2018-09-09 Thread sean

Richard Owlett wrote:

My bookmarks have grown like Topsy.
[ I've > 300 folders and >5000 bookmarks ]
I have many duplicates and the tree structure is a mess.
My goals include:
   1. Create a HTML file of bookmarks which:
  a. clearly shows the hierarchical structure of nested folders.
  b. allows searching for folder names as well as page titles.
  c. clearly shows in which the searched for file resides.
   2. find and purge duplicates.
   3. move folders around to create a more reasonable structure.

Looking for useful tools I found jq [https://stedolan.github.io/jq/].

An outline of my procedure is:
  1. export SeaMonkey bookmarks in JSON format.
  2. use jq to pretty print the JSON. {It does so nicely.}
  3. create HTML file described above.
  4. find duplicate targets and delete all but one.
  5. Each leaf of the bookmark tree is an object.
     Move these objects around to create a more friendly tree.
  6. Import the clean organized bookmarks.

The Tcl code below does #3. I've only sketched how to do #4.
[requires having done
     jq '.' yourrawbookmarks.json > prettytestalpha.json
]

Comments?





# Input is SeaMonkey bookmark file pretty printed with "jq"

set infile  "prettytestalpha.json"
set outfile "alphatest.html"

set fd_in  [open $infile  r]
set fd_out  [open $outfile w]

# set predefined values
set children    "\"child"
set uri    "\"uri\":"
set title    "\"title"
set rbracket    \]
set mylist [list $children $title $uri $rbracket]

# to be used at start of page of HTML
set preface {

PREalpha pretty bookmarks


PREalpha pretty bookmarks
}
set postlude {
}


# a reminder of how to format a clickable link
# $title


set myline    0
set outline 0
set indent ""
set plusindent " "
set sth1 ""
set enh1 ""
set aheading 0    ;# used to flag if $title is section label 
when =1


puts $fd_out $preface
while { ! [eof $fd_in] } {
   incr line
   gets $fd_in b_line
   set a_line [string trimleft $b_line]
   set c_line [string range $a_line 0 5]

   set x  [lsearch $mylist $c_line]
   if { ($x >= 0) } then {

     switch $x {
   0 {set indent $indent$plusindent; set aheading 1;}
   1 {set a_line [string replace $a_line 0 9];
  set a_line [string replace $a_line end-1 end];
  set title $a_line;
  if $aheading then {puts $fd_out "$sth1$indent$a_line$enh1";
  set aheading 0; incr myline}}
   2 {set a_line [string replace $a_line 0 6];
puts $fd_out "$indent  $title";
incr outline }
   3 {set indent [string replace $indent end-4 end];}
   }
  }
}


puts $fd_out "There are $myline folders"
puts $fd_out "There are $outline bookmarks"

puts $fd_out $postlude
close $fd_in
close $fd_out



Posting in this thread as it's gonna prove to be quite useful... and to 
help me locate it again when I have more time...


"A file that big?
  It might be very useful.
But now it is gone."

from: http://www.thezensite.com/non_Zen/haiku_for_windows.html
___
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey


Re: Prelude to removing duplicated bookmarks

2018-09-04 Thread NFN Smith

David E. Ross wrote:

Long ago, I realized that I wanted to see my bookmarks more often than
any Web page.  I set the preference variable
browser.bookmarks.autoExportHTML to True.  Actually, I have
user_pref("browser.bookmarks.autoExportHTML", true);
// automatically export bookmarks into an HTML file
in my user.js file in my profile.  (The // indicates a comment, to
remind me why I did this.)  Every time I terminate SeaMonkey, my
bookmarks are automatically exported to the file bookmarks.html in my
profile.


I do that, too. From there for other profiles that I'm using, as well as 
other browsers, I set the exported bookmarks.html to be the home page. 
With that, no matter which profile or which browser I'm using, I always 
have an up to date list of all my bookmarks available.


Smith

___
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey


Re: Prelude to removing duplicated bookmarks

2018-09-01 Thread GerardJan

David E. Ross wrote:

On 9/1/2018 1:38 PM, Richard Owlett wrote:

If retirement isn't for education what use is it?


Very good.  Retirement is also the best work of all.



I am retired, my one man company is
/Veuniks IT/
from the society of the /Delfts Studenten Corps/

--
https://facebook.com/gerardjan.vinkesteijn
Karl's version of Parkinson's Law:  Work expands to exceed the time alloted it.

User agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 
SeaMonkey/2.49.4

Build identifier: 20180711183816
___
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey


Re: Prelude to removing duplicated bookmarks

2018-09-01 Thread David E. Ross
On 9/1/2018 1:38 PM, Richard Owlett wrote:
> If retirement isn't for education what use is it?

Very good.  Retirement is also the best work of all.

-- 
David E. Ross


Too often, Twitter is a source of verbal vomit.  Examples include Donald
Trump, Roseanne Barr, and Elon Musk.
___
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey


Re: Prelude to removing duplicated bookmarks

2018-09-01 Thread Richard Owlett

On 09/01/2018 01:49 PM, David E. Ross wrote:

On 9/1/2018 10:26 AM, Richard Owlett wrote:

My bookmarks have grown like Topsy.
[ I've > 300 folders and >5000 bookmarks ]
I have many duplicates and the tree structure is a mess.
My goals include:
1. Create a HTML file of bookmarks which:
   a. clearly shows the hierarchical structure of nested folders.
   b. allows searching for folder names as well as page titles.
   c. clearly shows in which the searched for file resides.
2. find and purge duplicates.
3. move folders around to create a more reasonable structure.

Looking for useful tools I found jq [https://stedolan.github.io/jq/].

An outline of my procedure is:
   1. export SeaMonkey bookmarks in JSON format.
   2. use jq to pretty print the JSON. {It does so nicely.}
   3. create HTML file described above.
   4. find duplicate targets and delete all but one.
   5. Each leaf of the bookmark tree is an object.
  Move these objects around to create a more friendly tree.
   6. Import the clean organized bookmarks.

The Tcl code below does #3. I've only sketched how to do #4.
[requires having done
  jq '.' yourrawbookmarks.json > prettytestalpha.json
]

Comments?



[method snipped]

Long ago, I realized that I wanted to see my bookmarks more often than
any Web page.  I set the preference variable
browser.bookmarks.autoExportHTML to True.  Actually, I have
user_pref("browser.bookmarks.autoExportHTML", true);
// automatically export bookmarks into an HTML file
in my user.js file in my profile.  (The // indicates a comment, to
remind me why I did this.)  Every time I terminate SeaMonkey, my
bookmarks are automatically exported to the file bookmarks.html in my
profile.

In the userContent.css file in the chrome folder in my profile, I added
url("file:///xxx")
{ body { margin-left: 2em !important; font-size: 12pt }
h3 + dl { margin-left: 2em !important }  }
where "xxx" is the complete path to the file bookmarks.html.  (If you do
not have a userContent.css file, copy the file userContent-example.css
to make a userContent.css file.)

Using [Edit > Preferences > Browser], I set the radio button to "Home
page" for all three "Display on" selections and the same complete path
to the file bookmarks.html as above (including the file:/// but without
the quotation marks) in the input area "Clicking the home button takes
you to this group of pages".

All this gives me a nicely formatted display of my bookmarks.  Folder
names are bold.  Folder contents are indented, and subfolder contents
are indented farther.

Also, I do intentionally have some duplicate bookmarks.  When I create
them, I set duplicate tags for them.  This is not quite as good as the
old Netscape browser capability of creating a shortcut for a bookmark.
With that capability, changing a bookmark automatically changed the
shortcut.



If I understand, you have described how to have avoided the mess I'm in 
[i.e.  My bookmarks grew like Topsy resulting in > 300 folders and >5000 
bookmarks. ]


I have a profile set aside for experimentation. I posted the same code 
over on comp.lang.tcl and received several suggestions which will 
require research to understand. I'll try to implement what you outlined. 
Whether or not I succeed I'll live up to a tag line I've used:

"If retirement isn't for education what use is it?"


___
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey


Re: Prelude to removing duplicated bookmarks

2018-09-01 Thread David E. Ross
On 9/1/2018 10:26 AM, Richard Owlett wrote:
> My bookmarks have grown like Topsy.
> [ I've > 300 folders and >5000 bookmarks ]
> I have many duplicates and the tree structure is a mess.
> My goals include:
>1. Create a HTML file of bookmarks which:
>   a. clearly shows the hierarchical structure of nested folders.
>   b. allows searching for folder names as well as page titles.
>   c. clearly shows in which the searched for file resides.
>2. find and purge duplicates.
>3. move folders around to create a more reasonable structure.
> 
> Looking for useful tools I found jq [https://stedolan.github.io/jq/].
> 
> An outline of my procedure is:
>   1. export SeaMonkey bookmarks in JSON format.
>   2. use jq to pretty print the JSON. {It does so nicely.}
>   3. create HTML file described above.
>   4. find duplicate targets and delete all but one.
>   5. Each leaf of the bookmark tree is an object.
>  Move these objects around to create a more friendly tree.
>   6. Import the clean organized bookmarks.
> 
> The Tcl code below does #3. I've only sketched how to do #4.
> [requires having done
>  jq '.' yourrawbookmarks.json > prettytestalpha.json
> ]
> 
> Comments?
> 

[method snipped]

Long ago, I realized that I wanted to see my bookmarks more often than
any Web page.  I set the preference variable
browser.bookmarks.autoExportHTML to True.  Actually, I have
user_pref("browser.bookmarks.autoExportHTML", true);
// automatically export bookmarks into an HTML file
in my user.js file in my profile.  (The // indicates a comment, to
remind me why I did this.)  Every time I terminate SeaMonkey, my
bookmarks are automatically exported to the file bookmarks.html in my
profile.

In the userContent.css file in the chrome folder in my profile, I added
   url("file:///xxx")
{ body { margin-left: 2em !important; font-size: 12pt }
h3 + dl { margin-left: 2em !important }  }
where "xxx" is the complete path to the file bookmarks.html.  (If you do
not have a userContent.css file, copy the file userContent-example.css
to make a userContent.css file.)

Using [Edit > Preferences > Browser], I set the radio button to "Home
page" for all three "Display on" selections and the same complete path
to the file bookmarks.html as above (including the file:/// but without
the quotation marks) in the input area "Clicking the home button takes
you to this group of pages".

All this gives me a nicely formatted display of my bookmarks.  Folder
names are bold.  Folder contents are indented, and subfolder contents
are indented farther.

Also, I do intentionally have some duplicate bookmarks.  When I create
them, I set duplicate tags for them.  This is not quite as good as the
old Netscape browser capability of creating a shortcut for a bookmark.
With that capability, changing a bookmark automatically changed the
shortcut.

-- 
David E. Ross


Too often, Twitter is a source of verbal vomit.  Examples include Donald
Trump, Roseanne Barr, and Elon Musk.
___
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey


Prelude to removing duplicated bookmarks

2018-09-01 Thread Richard Owlett

My bookmarks have grown like Topsy.
[ I've > 300 folders and >5000 bookmarks ]
I have many duplicates and the tree structure is a mess.
My goals include:
  1. Create a HTML file of bookmarks which:
 a. clearly shows the hierarchical structure of nested folders.
 b. allows searching for folder names as well as page titles.
 c. clearly shows in which the searched for file resides.
  2. find and purge duplicates.
  3. move folders around to create a more reasonable structure.

Looking for useful tools I found jq [https://stedolan.github.io/jq/].

An outline of my procedure is:
 1. export SeaMonkey bookmarks in JSON format.
 2. use jq to pretty print the JSON. {It does so nicely.}
 3. create HTML file described above.
 4. find duplicate targets and delete all but one.
 5. Each leaf of the bookmark tree is an object.
Move these objects around to create a more friendly tree.
 6. Import the clean organized bookmarks.

The Tcl code below does #3. I've only sketched how to do #4.
[requires having done
jq '.' yourrawbookmarks.json > prettytestalpha.json
]

Comments?





# Input is SeaMonkey bookmark file pretty printed with "jq"

set infile  "prettytestalpha.json"
set outfile "alphatest.html"

set fd_in  [open $infile  r]
set fd_out  [open $outfile w]

# set predefined values
set children"\"child"
set uri "\"uri\":"
set title   "\"title"
set rbracket\]
set mylist [list $children $title $uri $rbracket]

# to be used at start of page of HTML
set preface {

PREalpha pretty bookmarks


PREalpha pretty bookmarks
}
set postlude {
}


# a reminder of how to format a clickable link
# $title


set myline  0
set outline 0
set indent   ""
set plusindent  " "
set sth1 ""
set enh1 ""
set aheading0   ;# used to flag if $title is section label when 
=1

puts $fd_out $preface
while { ! [eof $fd_in] } {
  incr line
  gets $fd_in b_line
  set a_line [string trimleft $b_line]
  set c_line [string range $a_line 0 5]

  set x  [lsearch $mylist $c_line]
  if { ($x >= 0) } then {

switch $x {
  0 {set indent $indent$plusindent; set aheading 1;}
  1 {set a_line [string replace $a_line 0 9];
 set a_line [string replace $a_line end-1 end];
 set title $a_line;
 if $aheading then {puts $fd_out "$sth1$indent$a_line$enh1";
 set aheading 0; incr myline}}
  2 {set a_line [string replace $a_line 0 6];
puts $fd_out "$indent  $title";
incr outline }
  3 {set indent [string replace $indent end-4 end];}
  }
 }
}


puts $fd_out "There are $myline folders"
puts $fd_out "There are $outline bookmarks"

puts $fd_out $postlude
close $fd_in
close $fd_out

___
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey