ipinfo.io
does NOT provide a three-letter country code. You'll have to manually produce an array:
var threeLtrCC.US = 'USA';
var threeLtrCC.IN = 'IND';
...
$.get("http://ipinfo.io", function (response) {
var cc = threeLtrCC[response.country];
$('#newURL').text('some_url?countryCode=' + cc);
$('#newURL').attr('href','some_url?countryCode=' + cc);
$("#details").html(JSON.stringify(response, null, 4));
}, "jsonp");
and then use response.country
as the key to find the value from your homemade array.
HTML
<a id="newURL"></a>