Export chrome bookmarks to org

Dec. 10, 2019

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)))))