vimperator + copy.js で goo.gl

もう誰かやっていると思うけれど, 以下を .vimperatorrc に追記.

js <<EOF
liberator.globalVariables.copy_templates = [
    { label: 'goo.gl', value: 'goo.gl short url', custom: function(){return JSON.parse(util.httpGet('http://ggl-shortener.appspot.com/?url='+encodeURIComponent(buffer.URL)).responseText).short_url;} },
    { label: 'hatena.with.goo.gl', value: 'get goo.gl short url', custom: function() {return '[' + JSON.parse(util.httpGet('http://ggl-shortener.appspot.com/?url='+encodeURIComponent(buffer.URL)).responseText).short_url + ':title='+ buffer.title + ']' ; } },
    { label: 'muse.with.goo.gl', value: 'get goo.gl short url', custom: function() {return '[[' + JSON.parse(util.httpGet('http://ggl-shortener.appspot.com/?url='+encodeURIComponent(buffer.URL)).responseText).short_url + ']['+ buffer.title + ']]' ; } },
];
EOF

使い方は :copy goo.gl とか.