Created
January 28, 2015 07:17
-
-
Save takuya/5dff5daa80cf31130315 to your computer and use it in GitHub Desktop.
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
document.body.appendChild(function(){ | |
sc = document.createElement("script"); | |
var code = function(){ | |
window.bitly_load=function(res){prompt("",res.data.url);} | |
} | |
src = "("+code.toString()+")();" | |
sc.type="text/javascript"; | |
sc.text=src | |
return sc; | |
}() | |
); | |
bi = new URL("https://api-ssl.bitly.com/v3/shorten?"); | |
var params = ["login=USERNAME", "domain=j.mp", "apiKey=API_KEY","callback=bitly_load", "longUrl=" + encodeURIComponent(location.href)]; | |
bi.search = "?" + params.join("&"); | |
document.body.appendChild(function(){ | |
sc = document.createElement("script"); | |
sc.type="text/javascript"; | |
sc.src = bi.toString() | |
return sc; | |
}() | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment