Last active
December 17, 2015 18:29
-
-
Save Jagua/5653116 to your computer and use it in GitHub Desktop.
support commands for reading now and/or later on Vimperator.
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
" Evernote Clearly: Clipper: Clip: " {{{ | |
" Evernote Clearly :: Add-ons for Firefox | |
" https://addons.mozilla.org/ja/firefox/addon/clearly/ | |
" Evernote Web Clipper :: Add-ons for Firefox | |
" https://addons.mozilla.org/ja/firefox/addon/evernote-web-clipper/ | |
" Clearly (toggle) | |
nnoremap e :<C-u>js __readable_by_evernote.__readable_by_evernote__launch(false)<CR> | |
" Clip to Evernote | |
nnoremap E :<C-u>js __readable_by_evernote.__readable_by_evernote__launch(true)<CR> | |
nmap <Leader>ea E | |
" }}} | |
" Instapaper: (simple version) " {{{ | |
nnoremap <Leader>ia :<C-u>instapaper<CR> | |
let g:instapaper_username = 'USERNAME' | |
let g:instapaper_password = 'PASSWORD' | |
js << EOM | |
// require: _libly.js | |
commands.addUserCommand( | |
['instapaper'], | |
'add pages to Instapaper', | |
function (args) { | |
function toQuery(qs) { | |
return [i + '=' + encodeURIComponent(qs[i]) | |
for (i in qs) | |
].join('&'); | |
} | |
var req = new plugins.libly.Request( | |
'https://www.instapaper.com/api/add', | |
{ | |
}, | |
{ | |
postBody: toQuery({ | |
username: liberator.globalVariables.instapaper_username, | |
password: liberator.globalVariables.instapaper_password, | |
url: buffer.URL, | |
}) | |
} | |
); | |
req.addEventListener('success', function(data) { | |
liberator.echo('This URL has been successfully added to your Instapaper account.'); | |
}); | |
req.addEventListener('failure', function(data) { | |
liberator.echoerr(data.statusText); | |
liberator.echoerr(data.responseText); | |
//liberator.echoerr('This URL has failed to add to your Instapaper account.'); | |
}); | |
req.addEventListener('exception', function(data) { | |
liberator.echoerr(data.statusText); | |
liberator.echoerr(data.responseText); | |
//liberator.echoerr('This URL has failed to add to your Instapaper account.'); | |
}); | |
req.post(); | |
},{ | |
literal: 0, | |
}, | |
true | |
); | |
EOM | |
" }}} | |
" Readability: " {{{ | |
" Readability :: Add-ons for Firefox | |
" https://addons.mozilla.org/ja/firefox/addon/readability/ | |
" read immediately | |
nnoremap <Leader>ra :<C-u>js rdb.firefox.overlay.read_now()<CR> | |
" read later | |
nnoremap <Leader>rl :<C-u>js rdb.firefox.overlay.read_later()<CR> | |
" send to kindle | |
nnoremap <Leader>rk :<C-u>js rdb.firefox.overlay.send_to_kindle()<CR> | |
" }}} | |
" CSS on/off (toggle): css: " {{{ | |
nnoremap ! :<C-u>set invum<CR> | |
" }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice share. Do you type in
:rk
to send to your Kindle?It's not working for me with the combinations I'm trying. But simply
:js rdb.firefox.overlay.send_to_kindle()
does work.