[SOLVED] about bookmarks

User Help for Mozilla Firefox
Post Reply
User avatar
ineuw
Posts: 743
Joined: March 19th, 2006, 4:17 pm
Location: Québec, Canada

[SOLVED] about bookmarks

Post by ineuw »

Is there an app that can import bookmarks.html or .json into a spreadsheet or a database?
Last edited by ineuw on March 13th, 2023, 8:59 pm, edited 1 time in total.
Firefox 115.0.2 (default install) in Linux Mint 21.2 Cinnamon 64 bit, updated on 2023-07-31 00:05
User avatar
BruceAWittmeier
Posts: 3076
Joined: June 9th, 2008, 10:53 am
Location: Near 37.501685 -80.147967

Re: about bookmarks

Post by BruceAWittmeier »

No app that I'm aware of, however...
You might get someone to write a specific parser (C code to selectively extract fields) and write it out to a text file, CSV file or something else if preferred. Text and CSV are easily imported to most databases.

The 7 or so links below are just a small fragment of a bookmarks file.
The code following is the source HTML that would have to be parsed.

There are very good string functions in C compilers available free on the web. I am just learning how to use Code::Blocks and convert some of my old C programs to Code::Blocks as my old Borlandc 3.1 does not run on Windows 10.

You would need to identify the fields you want to import -- read each line programatically and write out each desired field.

Know anyone in HS or College that needs a small project? Not a joke -- sometimes they need "real" applications to develop.

Code: Select all

This is what you see in a browser:

~~~~~~~~~~~~~~~~~
Bookmarks Menu

User Me

FirefoxAddonsTipsTricks

MDN Web Docs
Introducing the CSS Cascade - CSS: Cascading Style Sheets | MDN
CSS: Cascading Style Sheets | MDN
Resource URLs - HTTP | MDN
Search: "Mozilla"
General Services Administration | USAGov
A | A-Z Index of U.S. Government Departments and Agencies | USAGov
G | A-Z Index of U.S. Government Departments and Agencies | USAGov

~~~~~~~~~~~~~~~~~~
This is the source that generates the above:

<!DOCTYPE HTML>
<html>
<head>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'none'; img-src data: *; object-src 'none'">
<title>Bookmarks</title>
</head>
<body>
<h1>Bookmarks Menu</h1>
<dl>
<h3 add_date="1211363551" last_modified="1668205513">Me</h3>
<dl>
<h3 add_date="1619969315" last_modified="1668205513">FirefoxAddonsTipsTricks</h3>
<dl>
<dt><a href="https://developer.mozilla.org/en-US/"
add_date="1668192688" last_modified="1668192790"
icon_uri="fake-favicon-uri:https://developer.mozilla.org/en-US/"
icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABUElEQVQ4T83TP8gBYRzA8a+UUckmm8nMIKVusigdA8NNJpPFn7LcblAkZbgBm0kmJXWjdKNYTgYrZTnZdM4ze+/0vsv7q2d7nk/P758PsJ3z6/D9DyAQCFCr1Xg+n+i6zm63I5fLEYvFsCyL8Xj8Y4oihXQ6zXq95nw+0+v10DRNIPf7nVAoRDwedwfa7TbZbJZwOMxwOGQ+n3O5XOh2u+TzeW9guVxiGAaFQkEA1+uV0WiEqqo0Gg13wO/327fbjWKxSL/fZzAYiAfRaJTVakWz2XQHksmkvdlsRK7b7VYA1WqV6XTK4/HwBur1ul0qlUilUuz3eyaTCZ1OBwcmkUh4A4vFwj4ej7RaLQ6HA6ZpIkmSKGilUvEGnALa72q/+z+bzQgGg5xOJzEX7w4oikK5XHZvo9ciZDIZZFn+eO2rXYhEImIqP8VXgNsP/wy8AIEjkF8LPFYCAAAAAElFTkSuQmCC">MDN
Web Docs</a> </dt>
<dt><a
href="https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade"
add_date="1668192692" last_modified="1668192790"
icon_uri="fake-favicon-uri:https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade"
icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABUElEQVQ4T83TP8gBYRzA8a+UUckmm8nMIKVusigdA8NNJpPFn7LcblAkZbgBm0kmJXWjdKNYTgYrZTnZdM4ze+/0vsv7q2d7nk/P758PsJ3z6/D9DyAQCFCr1Xg+n+i6zm63I5fLEYvFsCyL8Xj8Y4oihXQ6zXq95nw+0+v10DRNIPf7nVAoRDwedwfa7TbZbJZwOMxwOGQ+n3O5XOh2u+TzeW9guVxiGAaFQkEA1+uV0WiEqqo0Gg13wO/327fbjWKxSL/fZzAYiAfRaJTVakWz2XQHksmkvdlsRK7b7VYA1WqV6XTK4/HwBur1ul0qlUilUuz3eyaTCZ1OBwcmkUh4A4vFwj4ej7RaLQ6HA6ZpIkmSKGilUvEGnALa72q/+z+bzQgGg5xOJzEX7w4oikK5XHZvo9ciZDIZZFn+eO2rXYhEImIqP8VXgNsP/wy8AIEjkF8LPFYCAAAAAElFTkSuQmCC">Introducing
the CSS Cascade - CSS: Cascading Style Sheets | MDN</a> </dt>
<dt><a href="https://developer.mozilla.org/en-US/docs/Web/CSS"
add_date="1668192673" last_modified="1668192790"
icon_uri="fake-favicon-uri:https://developer.mozilla.org/en-US/docs/Web/CSS"
icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABUElEQVQ4T83TP8gBYRzA8a+UUckmm8nMIKVusigdA8NNJpPFn7LcblAkZbgBm0kmJXWjdKNYTgYrZTnZdM4ze+/0vsv7q2d7nk/P758PsJ3z6/D9DyAQCFCr1Xg+n+i6zm63I5fLEYvFsCyL8Xj8Y4oihXQ6zXq95nw+0+v10DRNIPf7nVAoRDwedwfa7TbZbJZwOMxwOGQ+n3O5XOh2u+TzeW9guVxiGAaFQkEA1+uV0WiEqqo0Gg13wO/327fbjWKxSL/fZzAYiAfRaJTVakWz2XQHksmkvdlsRK7b7VYA1WqV6XTK4/HwBur1ul0qlUilUuz3eyaTCZ1OBwcmkUh4A4vFwj4ej7RaLQ6HA6ZpIkmSKGilUvEGnALa72q/+z+bzQgGg5xOJzEX7w4oikK5XHZvo9ciZDIZZFn+eO2rXYhEImIqP8VXgNsP/wy8AIEjkF8LPFYCAAAAAElFTkSuQmCC">CSS:
Cascading Style Sheets | MDN</a> </dt>
<dt><a
href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Resource_URLs"
add_date="1668192676" last_modified="1668192790"
icon_uri="fake-favicon-uri:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Resource_URLs"
icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABUElEQVQ4T83TP8gBYRzA8a+UUckmm8nMIKVusigdA8NNJpPFn7LcblAkZbgBm0kmJXWjdKNYTgYrZTnZdM4ze+/0vsv7q2d7nk/P758PsJ3z6/D9DyAQCFCr1Xg+n+i6zm63I5fLEYvFsCyL8Xj8Y4oihXQ6zXq95nw+0+v10DRNIPf7nVAoRDwedwfa7TbZbJZwOMxwOGQ+n3O5XOh2u+TzeW9guVxiGAaFQkEA1+uV0WiEqqo0Gg13wO/327fbjWKxSL/fZzAYiAfRaJTVakWz2XQHksmkvdlsRK7b7VYA1WqV6XTK4/HwBur1ul0qlUilUuz3eyaTCZ1OBwcmkUh4A4vFwj4ej7RaLQ6HA6ZpIkmSKGilUvEGnALa72q/+z+bzQgGg5xOJzEX7w4oikK5XHZvo9ciZDIZZFn+eO2rXYhEImIqP8VXgNsP/wy8AIEjkF8LPFYCAAAAAElFTkSuQmCC">Resource
URLs - HTTP | MDN</a> </dt>
<dt><a href="https://developer.mozilla.org/en-US/search?q=Mozilla"
add_date="1668192680" last_modified="1668192790"
icon_uri="fake-favicon-uri:https://developer.mozilla.org/en-US/search?q=Mozilla"
icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABUElEQVQ4T83TP8gBYRzA8a+UUckmm8nMIKVusigdA8NNJpPFn7LcblAkZbgBm0kmJXWjdKNYTgYrZTnZdM4ze+/0vsv7q2d7nk/P758PsJ3z6/D9DyAQCFCr1Xg+n+i6zm63I5fLEYvFsCyL8Xj8Y4oihXQ6zXq95nw+0+v10DRNIPf7nVAoRDwedwfa7TbZbJZwOMxwOGQ+n3O5XOh2u+TzeW9guVxiGAaFQkEA1+uV0WiEqqo0Gg13wO/327fbjWKxSL/fZzAYiAfRaJTVakWz2XQHksmkvdlsRK7b7VYA1WqV6XTK4/HwBur1ul0qlUilUuz3eyaTCZ1OBwcmkUh4A4vFwj4ej7RaLQ6HA6ZpIkmSKGilUvEGnALa72q/+z+bzQgGg5xOJzEX7w4oikK5XHZvo9ciZDIZZFn+eO2rXYhEImIqP8VXgNsP/wy8AIEjkF8LPFYCAAAAAElFTkSuQmCC">Search:
"Mozilla"</a> </dt>
<dt><a
href="https://www.usa.gov/federal-agencies/general-services-administration"
add_date="1520170561" last_modified="1520170561">General Services
Administration | USAGov</a> </dt>
<dt><a href="https://www.usa.gov/federal-agencies/a"
add_date="1520170572" last_modified="1668194236">A | A-Z Index of U.S.
Government Departments and Agencies | USAGov</a></dt>
</dl>
<dl>
<dt><a href="https://www.usa.gov/federal-agencies/g"
add_date="1520170567" last_modified="1648556174">G | A-Z Index of U.S.
Government Departments and Agencies | USAGov</a></dt>
<dd><br>
</dd>
</dl>
</dl>
</dl>
</body>
</html>
I often take a long windy road to my destination. Upon arrival, I wonder how I missed the shortcut.
morat
Posts: 6405
Joined: February 3rd, 2009, 6:29 pm

Re: about bookmarks

Post by morat »

There are plenty of JSON to CSV converters on the net.
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Re: about bookmarks

Post by dickvl »

You can look at this tool to inspect a compressed jsonlz4 bookmarks backup and possibly create an HTML version.
https://www.jeffersonscher.com/res/bookbackreader.html

Since all the JS code is in the HTML file, you should be able to modify its source code to export the bookmarks in a format your spreadsheet program understands.
User avatar
ineuw
Posts: 743
Joined: March 19th, 2006, 4:17 pm
Location: Québec, Canada

Re: about bookmarks

Post by ineuw »

dickvl wrote:You can look at this tool to inspect a compressed jsonlz4 bookmarks backup and possibly create an HTML version.
https://www.jeffersonscher.com/res/bookbackreader.html
The above is a very interesting tool. I converted a .jsonlz4 file to html, and the file was half the size of a directly exported bookmarks.html. Imported it to see if I lost anything, but everything was there.

Parsing was my day job before retiring, but I prefer to use an existing tool. However, I gave it a quick try and I can parse the HTML file and convert it to a .TSV file, but not for re-import as html, - just to peruse the dates, the subjects and the groupings. it is better to import it into a database where the http: is to be stored in a BLOB field. Some are way too long for a spreadsheet cell.
Firefox 115.0.2 (default install) in Linux Mint 21.2 Cinnamon 64 bit, updated on 2023-07-31 00:05
User avatar
BruceAWittmeier
Posts: 3076
Joined: June 9th, 2008, 10:53 am
Location: Near 37.501685 -80.147967

Re: about bookmarks

Post by BruceAWittmeier »

ineuw -- "Currently does not embed icon data." this is on the block HTML Export on Jeff's page. It appears to account for the big variation in file size.
I often take a long windy road to my destination. Upon arrival, I wonder how I missed the shortcut.
User avatar
ineuw
Posts: 743
Joined: March 19th, 2006, 4:17 pm
Location: Québec, Canada

Re: about bookmarks

Post by ineuw »

BruceAWittmeier wrote:ineuw -- "Currently does not embed icon data." this is on the block HTML Export on Jeff's page. It appears to account for the big variation in file size.
Thanks for pointing it out. Must learn to slow down.
Firefox 115.0.2 (default install) in Linux Mint 21.2 Cinnamon 64 bit, updated on 2023-07-31 00:05
kreemoweet
Posts: 778
Joined: December 30th, 2009, 11:25 pm

Re: about bookmarks

Post by kreemoweet »

ineuw wrote:Is there an app that can import bookmarks.html or .json into a spreadsheet or a database?
NirSoft to the rescue (again!): http://blog.nirsoft.net/2021/05/04/book ... d-firefox/
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: about bookmarks

Post by jscher2000 »

The Zotero research/bibliography program can import a bookmarks.html file, but if you don't need those kinds of features to working with your list, then, never mind.
User avatar
ineuw
Posts: 743
Joined: March 19th, 2006, 4:17 pm
Location: Québec, Canada

Re: [SOLVED] about bookmarks

Post by ineuw »

I forgot to post the solution, which I found to be the best for my purposes. It's the screen output of the Firefox extension
https://addons.mozilla.org/en-US/firefo ... ozilla.org

Copying and pasting the single page output of the extension (of about 2,600 bookmarks) is simple. The "|" pipe dividers between the folder/content levels makes for easy identification of the hierarchies.

Code: Select all

	Bookmarks Menu | news and publications | anglophone | abc news (australian)
	Bookmarks Menu | news and publications | anglophone | bbc
	Bookmarks Menu | news and publications | anglophone | new statesman
	Bookmarks Menu | news and publications | anglophone | sydney morning herald
	Bookmarks Menu | news and publications | anglophone | the economist
	Bookmarks Menu | news and publications | anglophone | the fortnightly review
	Bookmarks Menu | news and publications | anglophone | the guardian
	Bookmarks Menu | news and publications | anglophone | the independent
Firefox 115.0.2 (default install) in Linux Mint 21.2 Cinnamon 64 bit, updated on 2023-07-31 00:05
Post Reply