Richard Owlett wrote on 18/08/2018 1:44 PM:
On 08/09/2018 02:49 AM, Daniel wrote:
Richard Owlett wrote on 9/08/2018 4:09 AM:
On 08/08/2018 09:41 AM, Richard Owlett wrote:
On 08/08/2018 08:34 AM, Daniel wrote:
Richard Owlett wrote on 8/08/2018 10:38 PM:
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

Richard, you have my attention! About a month ago, I asked, here,
 about sorting out duplicate, or even triplicate, entries in the
 Bookmarks folder.

I've got zero experience with JSON, but will be interested in any
 discussion here!

If you know the bookmark's title or uri you can do it manually. Use
the bookmarks manager to export in JSON format. Make a copy in
another directory to manipulate. Run jq's pretty print function to
create a file to edit. Open with a plain text editor (notebook
etc).

Search for your duplicated book mark.

A sample from my system is:

{ "guid": "yb3hKkKKqQSh", "title": "Debootstrap (Shallow
Thoughts)", "index": 1, "dateAdded": 1487768687157000, "lastModified": 1487768687157000, "id": 34488, "iconuri": "http://shallowsky.com/favicon.ico";, "type": "text/x-moz-place", "uri": "http://shallowsky.com/blog/linux/install/debootstrap.html"; }, . . .

{ "guid": "hvuonjDqIu5X", "title": "Debootstrap (Shallow
Thoughts)", "index": 2, "dateAdded": 1488384546925000, "lastModified": 1488384546925000, "id": 34549, "iconuri": "http://shallowsky.com/favicon.ico";, "type": "text/x-moz-place", "uri": "http://shallowsky.com/blog/linux/install/debootstrap.html"; },

Note the different indentations. That is an indicator of how deeply
 nested that occurrence is.

Delete everything "{" to "}" inclusive. If there is a comma after
the closing brace, delete it also.

Repeat for other duplicates.

Use the bookmark manager's restore function to load the edited
JSON. There should be no problem. You did start with a backup
didn't you? <grin>

I'm looking to automate it as I have no idea which have
duplicates. HTH

I've blocked out a method to list all unique titles and purge duplicates. Hopefully I'll have something workable early next weeks.

Hey, I've been waiting a couple of months, Richard, a couple of weeks more should be no problem. Best of luck with your endeavours!


Have made progress :]
BUT creating useful output in JSON format acceptable to SeaMonkey unlikely :[

Boo! Hiss!!

HOWEVER I expect I'll be able to create a HTML file which can serve nicely as bookmarks. That was one of my initial alternative goals.

SeaMonkey used to, natively, I think, do this!!

Yes, Bookmarks->Manage Bookmarks then, in the Bookmark Manager, Tools->Export HTML....

Maybe that's a way ... Export as HTML, then edit the HTML file directly.

My path to that will depend on Linux tools. I suspect similar tools exist in Windows. I will be creating a description of my combination of scripts and manual edits.

Thanks for your continued efforts, Richard.

--
Daniel

User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 SeaMonkey/2.49.1 Build identifier: 20171016030418

User agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 SeaMonkey/2.49.1 Build identifier: 20171015235623
_______________________________________________
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to