[SOLVED] about bookmarks
- ineuw
- Posts: 743
- Joined: March 19th, 2006, 4:17 pm
- Location: Québec, Canada
[SOLVED] about bookmarks
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
- BruceAWittmeier
- Posts: 3076
- Joined: June 9th, 2008, 10:53 am
- Location: Near 37.501685 -80.147967
Re: about bookmarks
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.
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.
-
- Posts: 6426
- Joined: February 3rd, 2009, 6:29 pm
Re: about bookmarks
There are plenty of JSON to CSV converters on the net.
- dickvl
- Posts: 54161
- Joined: July 18th, 2005, 3:25 am
Re: about bookmarks
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.
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
- Posts: 743
- Joined: March 19th, 2006, 4:17 pm
- Location: Québec, Canada
Re: about bookmarks
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.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
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
- BruceAWittmeier
- Posts: 3076
- Joined: June 9th, 2008, 10:53 am
- Location: Near 37.501685 -80.147967
Re: about bookmarks
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
- Posts: 743
- Joined: March 19th, 2006, 4:17 pm
- Location: Québec, Canada
Re: about bookmarks
Thanks for pointing it out. Must learn to slow down.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.
Firefox 115.0.2 (default install) in Linux Mint 21.2 Cinnamon 64 bit, updated on 2023-07-31 00:05
-
- Posts: 778
- Joined: December 30th, 2009, 11:25 pm
Re: about bookmarks
NirSoft to the rescue (again!): http://blog.nirsoft.net/2021/05/04/book ... d-firefox/ineuw wrote:Is there an app that can import bookmarks.html or .json into a spreadsheet or a database?
- jscher2000
- Posts: 11762
- Joined: December 19th, 2004, 12:26 am
- Location: Silicon Valley, CA USA
- Contact:
Re: about bookmarks
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.
- ineuw
- Posts: 743
- Joined: March 19th, 2006, 4:17 pm
- Location: Québec, Canada
Re: [SOLVED] about bookmarks
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.
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