Skip to content

Instantly share code, notes, and snippets.

@colobas
Last active November 10, 2020 06:56
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 colobas/8291e6780caa90b0db5ec848c50dc3ba to your computer and use it in GitHub Desktop.
Save colobas/8291e6780caa90b0db5ec848c50dc3ba to your computer and use it in GitHub Desktop.
export my to-read list to pocket
(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