I am trying to use bit.ly api to automatically shorten URLs for my blog but this code does not seem to be working
<script>getShortUrl: function(url, callback)
{
var url = 'https://api-ssl.bitly.com/v3/shorten?access_token=***********************&longUrl=http%3A%2F%2Fwww.techforty.com';
$.getJSON(
url,
{},
function(response)
{
if(callback)
callback(response.data.url);
}
);
},</script>
Is there a quick and easy way to get short URL out of this script in an input box?