// PLUGIN_INFO//{{{
var PLUGIN_INFO =
{NAME}
TinyURL from Vimperator
hogelog
0.1
2.0pre
2.0pre
https://github.com/vimpr/vimperator-plugins/raw/master/tinyurl.js
;
//}}}
(function() {
const TinyAPI = 'http://tinyurl.com/api-create.php?url=';
commands.add(['tinyurl'], 'echo and copy TinyURL',
function(args) util.copyToClipboard(tiny.getTiny(args.length==0 ? buffer.URL : args.string), true),
{
argCount: '?',
});
commands.add(['expandurl'], 'expand TinyURL',
function(args) util.copyToClipboard(tiny.getExpand(args.string), true),
{
argCount: '1',
});
var tiny = plugins.tinyurl = {
getTiny: function(url)
util.httpGet(TinyAPI+encodeURIComponent(url)).responseText,
getExpand: function (url)
util.httpGet(url).channel.name
};
})();
// vim: fdm=marker sw=4 ts=4 et:
ullscreen'>stella/nico-fullscreen
for Vimperator plugins | |
blob: 106f69073561333dcdf644526bae3df0d180714f (
plain)