Skip to content

Instantly share code, notes, and snippets.

@hjst
Created August 28, 2017 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hjst/57ba1f821e8fd67d922419d61ff1081e to your computer and use it in GitHub Desktop.
Save hjst/57ba1f821e8fd67d922419d61ff1081e to your computer and use it in GitHub Desktop.
ELisp function to send the URL under the cursor to Pocket for reading later (uses msmtp)
(require 'url-util)
(defun hjst/send-to-pocket ()
"Send the URL at point to Pocket for reading later"
(interactive)
(let
((url (url-get-url-at-point)))
(start-process-shell-command "msmtp" "*send-to-pocket*"
(concat "printf 'Add:\n%s\n'"
url
"| msmtp add@getpocket.com"))
(with-current-buffer "*send-to-pocket*"
(save-excursion
(goto-char (point-max))
(insert (concat "Adding: " url))))
(message "Sent to Pocket")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment