Add bookmark captures to Wallabag automatically

This commit is contained in:
Jeremy Dormitzer 2020-02-07 14:35:04 -05:00
parent 58f9c4bea5
commit 62ffd3382c

View File

@ -1461,7 +1461,8 @@ A function to add ids to every heading in an Org file:
(format "[[%s][%s]]" url title)))
(defun org-capture-bookmark-after-finalize ()
"Runs `org-board-new' on the captured entry."
"Runs `org-board-new' on the captured entry.
Also saves to Wallabag."
(let ((success (not org-note-abort))
(key (plist-get org-capture-plist :key))
(desc (plist-get org-capture-plist :description)))
@ -1470,6 +1471,13 @@ A function to add ids to every heading in an Org file:
(equal desc "Bookmark")
org-capture-bookmark-last-url)
(org-board-new org-capture-bookmark-last-url)
(wallabag-add-entry org-capture-bookmark-last-url
(cl-function
(lambda (&key data &allow-other-keys)
(let ((entry-url (format "%s/view/%s"
wallabag-base-url
(alist-get 'id data))))
(message "Added bookmark to Wallabag: %s" entry-url)))))
(setq org-capture-bookmark-last-url nil))))
(with-eval-after-load 'org
@ -4975,3 +4983,17 @@ Enable ANSI colors in compile buffers:
(ansi-color-apply-on-region compilation-filter-start (point-max)))
(add-hook 'compilation-filter-hook #'colorize-compilation-buffer)
#+END_SRC
* Wallabag
[[https://github.com/jdormit/emacs-wallabag-client][My Wallabag client]] is still a WIP, but it is useful enough to pull in
right now:
#+BEGIN_SRC emacs-lisp
(use-package wallabag
:straight (:host github :repo "jdormit/emacs-wallabag-client")
:custom
(wallabag-base-url "https://wallabag.jeremydormitzer.com")
(wallabag-client-id (password-store-get "wallabag-client-id"))
(wallabag-client-secret (password-store-get "wallabag-client-secret"))
(wallabag-username "jdormit")
(wallabag-password (password-store-get "wallabag.jeremydormitzer.com")))
#+END_SRC