📜 ⬆️ ⬇️

Quick link shortening by bit.ly service

Seeing a convenient bookmarklet for goo.gl decided to modify it for bit.ly service, since many people use this particular service.

Everything is the same, create a bookmark and copy the following code into its URL:

javascript:window.bitly_callback = function(response){;if(response.errorCode){alert("An error occured: " + response.errorMessage);}else{prompt('', response.results[window.location.href].shortCNAMEUrl);}}; var s = document.createElement("script"); s.src = "http://api.bit.ly/shorten?version=2.0.1&longUrl=" + encodeURIComponent(window.location.href) + "&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&callback=bitly_callback"; void(document.body.appendChild(s));


Next, being on the page, the URL of which you want to reduce - click on this bookmarklet and we get an abbreviated link
')


UPD: Payne habrauser gave a link to two more advanced official bookmarklets for bit.ly

Source: https://habr.com/ru/post/81366/


All Articles