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: Mohamed Aziz Knani

Date: 2020-05-27 Wed 16:18

Emacs 25.2.2 (Org mode 9.3.6)

Validate

hacker emblem