aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-10-01 23:56:47 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-10-01 23:56:47 -0300
commit3d03267138102bf1f5ab60c66e0fcca18db3b6cd (patch)
tree8a4223bf94c86b751ed9835eacd8cc4f232bd2f1
parent9bd4c3adcdad98963fb8b5701c671836c48d0118 (diff)
downloadscripts-3d03267138102bf1f5ab60c66e0fcca18db3b6cd.tar.gz
scripts-3d03267138102bf1f5ab60c66e0fcca18db3b6cd.tar.bz2
Initial version of export-firefox-bookmarks
-rwxr-xr-xexport-firefox-bookmarks13
1 files changed, 13 insertions, 0 deletions
diff --git a/export-firefox-bookmarks b/export-firefox-bookmarks
new file mode 100755
index 0000000..18d249a
--- /dev/null
+++ b/export-firefox-bookmarks
@@ -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