- Timer.timeout(4) do
- ipinfo = Quova::IpInfo.new(ip_address)
-
- if ipinfo.status == Quova::SUCCESS
- country = ipinfo.country_code
- else
- Net::HTTP.start("api.hostip.info") do |http|
- country = http.get("/country.php?ip=#{ip_address}").body
- country = "GB" if country == "UK"
- end
- end