On 8/19/18, Daniel <[email protected]> wrote:
> Paul Bergsagel wrote on 19/08/2018 12:18 PM:
>> Richard Owlett wrote:
>>> My bookmarks have grown like Topsy
>>> I have many duplicates and the tree structure is a mess.
>>> I have two primary goals:
>>>   1. find and purge duplicates.
>>>   2. move folders around to create a more reasonable structure.
>>>
>>> After trying several approaches and looking for useful tools I found
>>> jq [https://stedolan.github.io/jq/]. One related page I found is titled
>>> "jq is sed for JSON".
>>>
>>> An outline of a possible procedure might be:
>>>  1. Export SeaMonkey bookmarks in JSON format.
>>>  2. use jq to pretty print the JSON. It does so nicely.
>>>  3. Find duplicate targets and delete all but one.
>>>  4. Each leaf of the bookmark tree is an object.
>>>     Move these objects around to create a more friendly tree.
>>>  5. Import the clean organized bookmarks.
>>>
>>> Has anyone done this?
>>> Is there a friendly in depth jq tutorial? The ones I've found tend to be
>>> on the "Hello world" level. There is just enough to tantalize.
>>>
>>> Links of interest include:
>>> https://stedolan.github.io/jq/manual/v1.5/
>>> http://stedolan.github.io/jq/tutorial/
>>> https://robots.thoughtbot.com/jq-is-sed-for-json
>>>
>> I have a limited understanding of programming and do not consider myself
>> a programmer at all. Here is my question: "Would it be possible to
>> create a plug in that would sort and locate duplicate bookmarks from
>> within SeaMonkey rather than having to export the bookmarks and use an
>> outside program?  Isn't there a way to automate advanced bookmark
>> management using a plug in?"

Most probably someone could write an addon to do that.  But aside from
needing someone to actually write it, Firefox is real close to
dropping support for ESR 52.x - which means all the old addons will no
longer work in any supported version of FF.

Since SM is based on FF ESR & I haven't seen anything about SM adding
support for the new FF webextensions yet, any addon written for SM
will probably work only until the next (next +1?) release.  So not
worth the effort (also see https://xkcd.com/1319/)


If you haven't seen this yet it's worth reading:
 
http://www.downthemall.net/re-downthemall-and-webextensions-or-why-why-i-am-done-with-mozilla/

DTA was one of the most popular addons; I'm guessing that after much
begging the developer agreed to try and update his code to use the new
FF webextensions crapfest[1].  But check the home page:
    News
    (Lack of) Progress   December 21, 2017

DTA hasn't been converted to a web extension yet :(  And the addon
that does sortof work has issues:

https://addons.mozilla.org/en-US/firefox/addon/download-star/
  Note: The downloads API in web extensions is lacking in many
features. Currently, you can only place downloads inside of Firefox's
default downloads folder. Files served using Content-Disposition
header to provide a filename cannot be handled properly. Skip existing
files is based on remembering downloaded URLs, since there is no API
to test for existence of a file.

> I am fairly certain that there used to be an external program that would
> check a FireFox Bookmarks file looking for duplicates.

It's easy enough to write one:

$ cat ~/bin/findDupBookmarks.sh
#!/bin/sh
# input: FF/SM 'Export Bookmarks to HTML' file

BMF="$1"
# bookmark file name, should at least make sure it exists

grep '<A HREF=' ${BMF}              |\
 sed -e 's/^ *<DT><A HREF="//'       \
     -e 's/ ADD_DATE="[^"]*"//'      \
     -e 's/ LAST_MODIFIED="[^"]*"//' \
     -e 's/ LAST_CHARSET="[^"]*"//'  \
     -e 's/ TAGS="[^"]*"//'          \
     -e 's/">[^>]*>//'              |\
 sort | uniq -d

> But I think that was back in the days when Bookmarks were in a separate
> file (was it Bookmarks.html) rather than being part of the bigger,
> better, file that it now is.

open the bookmarks manager and select Tools / Export HTML

Regards,
Lee


[1] - yes, it is harsh.  But you don't remove the old system until the
replacement system is at least close to feature-parity w/ the old
without upsetting your users.
_______________________________________________
support-seamonkey mailing list
[email protected]
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to