Last active
August 29, 2015 14:22
-
-
Save volh/11bc5e8c0a31ceebf7d3 to your computer and use it in GitHub Desktop.
Capture bookmarks from web browser right to your Org file with proper template
This file contains 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
// Integration with Conkeror | |
// For Firefox, see https://addons.mozilla.org/ru/firefox/addon/org-mode-capture/ | |
function org_capture (url, title, selection, window) { | |
// Note the 'w' as capture template | |
var cmd_str = 'emacsclient \"org-protocol://capture:/w/'+url+'/'+title+'/'+selection+'\"'; | |
if (window != null) { | |
window.minibuffer.message('Issuing ' + cmd_str); | |
} | |
shell_command_blind(cmd_str); | |
} | |
interactive("org-capture", "Clip url, title, and selection to capture via org-protocol", | |
function (I) { | |
org_capture(encodeURIComponent(I.buffer.display_uri_string), encodeURIComponent(I.buffer.document.title), encodeURIComponent(I.buffer.top_frame.getSelection()), I.window); | |
}); |
This file contains 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
(require 'org-protocol) | |
(setq org-capture-templates | |
(quote | |
(("w" | |
"Web Bookmark" | |
entry | |
(file+headline "~/notes/notes.org" "Bookmarks") | |
"* %c %u" | |
:empty-lines 1 :immediate-finish t) | |
))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment