News for hackers. Stuff that matters.
Re:Ask HN: Why are bookmarks second class citizens in browsers? by alin23 on Thursday August 18, 2022 @03:22AM (#32506378)
I actually had to do this yesterday for a small fuzzy search through bookmarks thing I’m building for myself.

It was something like:

    SELECT url FROM moz_places WHERE id IN (SELECT fk FROM moz_bookmarks)
You can find more info on that database here: https://wiki.mozilla.org/Places/Places_SQL_queries_best_prac...
Re:Ask HN: Why are bookmarks second class citizens in browsers? by mg on Thursday August 18, 2022 @03:39AM (#32506500)
That only gives you the urls though.

You lose the names, the folder structure, the order and the keywords.

The HTML format FireFox can create is so nice, that for now I am willing to manually book them up to get that. Until someone can come up with a way to automate it.

Re:Ask HN: Why are bookmarks second class citizens in browsers? by alin23 on Thursday August 18, 2022 @04:15AM (#32506773)
You can get names, folder, and ordered by date added in a nice JSON format:

    sqlite3 -json /tmp/places.sqlite '\
        SELECT p.url, b.title, (SELECT f.title FROM moz_bookmarks f WHERE fk IS NULL AND f.id=b.parent) AS folder \
        FROM moz_places p \
        INNER JOIN moz_bookmarks b ON b.fk=p.id \
        ORDER BY b."dateAdded"'
The full folder structure might be a bit more complex to get, I only have them on the top level and can’t experiment. Not sure what the keywords, never used such a thing.

I only rely on the title, and I’ll extract the text content of the link for a full text search through it because usually I’ll remember something from the contents and will try to search that instead of something from the title. I can’t predict what I’ll remember.