Export chrome bookmarks to org

Simple code to parse chrome bookmarks output, and spit it to an org file.

(spit BOOKMARKSFILEORG
      (let [file (slurp BOOKMARKSFILEHTML)
	    hickorystuff (-> file
			     h/parse
			     h/as-hickory)]
	(clojure.string/join "\n" (map (fn [x] (let [content (:content x)
						    link (-> x
							     :attrs
							     :href)]
						(format "* [[%s][%s]]" link (clojure.string/replace
									     (first content)
									     #"\[|\]"
									     {"[" "{"
									      "]" "}"}))))
				       (hs/select (hs/tag :a)
						  hickorystuff)))))

Author: Aziz Knani

Date: 2023-03-22 Wed 00:01

Emacs 26.3 (Org mode 9.1.9)

Tunisian flag