]> gitweb.fluxo.info Git - scripts.git/commitdiff
Initial version of export-firefox-bookmarks
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Oct 2020 02:56:47 +0000 (23:56 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Oct 2020 02:56:47 +0000 (23:56 -0300)
export-firefox-bookmarks [new file with mode: 0755]

diff --git a/export-firefox-bookmarks b/export-firefox-bookmarks
new file mode 100755 (executable)
index 0000000..18d249a
--- /dev/null
@@ -0,0 +1,13 @@
+#!/usr/bin/env/bash
+#
+# Export Mozilla Firefox bookmarks.
+# Based on https://github.com/pirate/ArchiveBox/blob/master/bin/export_browser_history.sh
+#
+
+# Base folder to work on
+BASEDIR="$HOME/.mozilla"
+
+# There might be many places.sqlite on many profiles
+find $BASEDIR -name places.sqlite | while read file; do \
+  sqlite3 $file "SELECT \"[\" || group_concat(json_object('timestamp', b.dateAdded, 'description', b.title, 'href', f.url)) || \"]\" FROM moz_bookmarks AS b JOIN moz_places AS f ON f.id = b.fk"
+done