From 2e126fd45216b5ec220d21333c48d996115ca60b Mon Sep 17 00:00:00 2001 From: mitsugu oyama Date: Thu, 19 Apr 2012 12:03:25 +0900 Subject: wipe out API --- goo.gl.js | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 goo.gl.js (limited to 'goo.gl.js') diff --git a/goo.gl.js b/goo.gl.js deleted file mode 100644 index df6feeb..0000000 --- a/goo.gl.js +++ /dev/null @@ -1,55 +0,0 @@ -// INFO // -var INFO = - - Mitsugu Oyama - anekos - MIT - -

- You can get short URL by goo.gl by this plugin. -

- - 'goo.gl' - :googl Long URL - -

You can get short URL by goo.gl by this plugin.

-
-
-
; - -(function(){ - let short_url=function(long_url){ - let req=new XMLHttpRequest(); - req.addEventListener("load",function(){ - let response=JSON.parse(req.responseText); - liberator.echo(response.short_url); - util.copyToClipboard(response.short_url,true); - },false); - req.addEventListener("error",function(){ - liberator.echo("Responce errror status from goo.gl. Status Code:" + req.status); - },false); - req.open("POST", "http://goo.gl/api/shorten?url="+encodeURIComponent(long_url)); - req.setRequestHeader("X-Auth-Google-Url-Shortener","true"); - req.send(); - }; - commands.addUserCommand( - ["googl"], - "Get short URL from Google", - function(args){ - let long_url; - if(args.length==0){ - long_url=buffer.URL; - }else if(args.length==1){ - long_url=args.literalArg; - }else{ - liberator.echoerr('argument error'); - return; - } - short_url(long_url); - }, { - literal: 0 - }, true); -})(); -- cgit v1.2.3