My goal is to write a php function:
getCountry($url) {
...
return $countryCode;
}
Is there are "good enough" way to detect the country of a website ?
I am talking about country, not the geoip of the server.
If my strategy good enough ?
if tld is local (ex: .fr)->France
else parse Header Accept-Language: en-US or parse the html page.
Maybe there is an remote API for that ? like the whois ?