I\'m looking for an on the fly URL shortener much like how tweetdeck works. I have found many jQuery and general javascript plugins that take a url and run it through a shor
I guess the API of Bitly has changed slightly. You now only really need an access token to request a short URL.
Following the best practices, I created the following Javascript-only snippet:
getShortUrl: function(url, callback)
{
var accessToken = '___YOUR_ACCESS_TOKEN___';
var url = 'https://api-ssl.bitly.com/v3/shorten?access_token=' + accessToken + '&longUrl=' + encodeURIComponent(url);
$.getJSON(
url,
{},
function(response)
{
if(callback)
callback(response.data.url);
}
);
},