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: 2019-12-10 Tue 17:48

Emacs 26.3 (Org mode 9.2.6)

Validate

hacker emblem