Last active
November 10, 2020 06:56
-
-
Save colobas/8291e6780caa90b0db5ec848c50dc3ba to your computer and use it in GitHub Desktop.
export my to-read list to pocket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun parse-entry () | |
(let* ((data (org-heading-components)) | |
(link-string (nth 4 data)) | |
(tags-string (nth 5 data)) | |
(link-match (s-match "\\[\\[\\(\\([^\]\:]*\\)\://[^\]]*\\)\\]\\[\\([^\]\:]*\\)\\]\\]" link-string)) | |
(link (nth 1 link-match)) | |
(protocol (nth 2 link-match)) | |
(title (nth 3 link-match)) | |
(dummy (message title)) | |
(tags (if tags-string | |
(s-split "\\:" (nth 1 (s-match "\:\\(.*\\)\:" tags-string))) | |
nil))) | |
(if (not (string= "file" protocol)) | |
(pocket-lib-add-urls link :tags tags) | |
()) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment