fetch('https://api.ipregistry.co/?key=tryout')
.then(function (response) {
return response.json();
})
.then(function (payload) {
console.log(payload.location.country.name);
var cntr = payload.location.country.name;
if( cntr == "United States" ){
jQuery("div#gplaybtn .banner__btns a:nth-child(2)").attr("href", "https://play.google.com/store/apps/");
//alert(cntr);
}
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter