MozillaZine


about bookmarks

User Help for Mozilla Firefox
ineuw

User avatar
 
Posts: 739
Joined: March 19th, 2006, 4:17 pm
Location: Québec, Canada

Post Posted December 6th, 2022, 3:44 pm

Is there an app that can import bookmarks.html or .json into a spreadsheet or a database?
Firefox 108.0.1 in Linux Mint 21 Cinnamon 64 bit - updated on 2022-12-29 23:58

BruceAWittmeier

User avatar
 
Posts: 3053
Joined: June 9th, 2008, 10:53 am
Location: Near 37.501685 -80.147967

Post Posted December 6th, 2022, 4:36 pm

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: 5428
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 6th, 2022, 5:24 pm

There are plenty of JSON to CSV converters on the net.

dickvl

User avatar
 
Posts: 53854
Joined: July 18th, 2005, 3:25 am

Post Posted December 6th, 2022, 5:45 pm

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.

ineuw

User avatar
 
Posts: 739
Joined: March 19th, 2006, 4:17 pm
Location: Québec, Canada

Post Posted December 8th, 2022, 7:16 am

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 108.0.1 in Linux Mint 21 Cinnamon 64 bit - updated on 2022-12-29 23:58

BruceAWittmeier

User avatar
 
Posts: 3053
Joined: June 9th, 2008, 10:53 am
Location: Near 37.501685 -80.147967

Post Posted December 9th, 2022, 6:05 am

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.

ineuw

User avatar
 
Posts: 739
Joined: March 19th, 2006, 4:17 pm
Location: Québec, Canada

Post Posted December 9th, 2022, 7:56 am

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 108.0.1 in Linux Mint 21 Cinnamon 64 bit - updated on 2022-12-29 23:58

kreemoweet
 
Posts: 776
Joined: December 30th, 2009, 11:25 pm

Post Posted December 13th, 2022, 11:27 pm

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/

jscher2000

User avatar
 
Posts: 11689
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted December 16th, 2022, 5:40 pm

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.

Return to Firefox Support


Who is online

Users browsing this forum: No registered users and 4 guests