From 62ffd3382c500c8adc5821309d86b953afd0ced2 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 7 Feb 2020 14:35:04 -0500 Subject: [PATCH] Add bookmark captures to Wallabag automatically --- emacs/init.org | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index f851040..afbda7a 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -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