geoip

Extracting XML data to php [duplicate]

拜拜、爱过 提交于 2020-01-28 08:41:12
问题 This question already has answers here : How do you parse and process HTML/XML in PHP? (30 answers) Closed 6 years ago . I'm trying to extract data from XML file (http://freegeoip.net/xml/google.com). You can see the content of the file looks something like: <Response> <Ip>74.125.235.3</Ip> <CountryCode>US</CountryCode> <CountryName>United States</CountryName> <RegionCode>CA</RegionCode> <RegionName>California</RegionName> <City>Mountain View</City> <ZipCode>94043</ZipCode> <Latitude>37.4192<

geoIP find country from ASP.NET

落爺英雄遲暮 提交于 2020-01-14 22:48:29
问题 From an ASP.NET page I'm able to retrieve the client's IP address (at least the apparent one). I would like to know if there is a free service that I can access from code-behind, that will return the country (no need for city) when queried with the IP. I can't make do with web http based services where you have to enter the IP manually, I have thousands of visits per day! Any clue welcome. 回答1: Yes, Check It Out! Good luck! EDITED: Since you did not specify a language I went ahead and created

geoIP find country from ASP.NET

[亡魂溺海] 提交于 2020-01-14 22:47:05
问题 From an ASP.NET page I'm able to retrieve the client's IP address (at least the apparent one). I would like to know if there is a free service that I can access from code-behind, that will return the country (no need for city) when queried with the IP. I can't make do with web http based services where you have to enter the IP manually, I have thousands of visits per day! Any clue welcome. 回答1: Yes, Check It Out! Good luck! EDITED: Since you did not specify a language I went ahead and created

客户端灰度发布,NGINX+GeoIP2+GeoIP Database

懵懂的女人 提交于 2020-01-07 19:32:36
需求的产生 (分地区更新) 我们公司呢是做电商平台的,其主打商品里有一款智能饮水机产品,而每台智能饮水机产品都是装在全国客户的家里。为了售后维护需要服务端如何保存数据并传回这块实现较简单,而在远程展示水机的余额、归属地、出水的质量等功能这块是由水机自身所镶嵌的一块智能PAD屏所完成,其PAD内部安装的是安卓系统; 在由开发完成新功能的开发后需迭代智能PAD屏内部安卓系统APK版本时,在更新版本这块我们一直做的方法是全量更新不做任何更新上的限制。但随着业务量的增加全国大概有30万台水机版本需要更新,显然之前的更新方式不再适用于现有这种高业务量的需求了。所以我们考虑了一个新的更新方案 "按地区更新"; 参考的方案 一、最直接的方案是购买阿里云的CDN,利用CDN的缓存来实现。缓存原理如下 通过CDN访问的流程是:客户端-->CDN L1--->CDN L2--->源站; 客户端请求到的CDN节点是CDN的L1节点,当客户端请求到CDN的L1节点向该节点请求一个资源的时候,该CDN节点会查询本节点是否有这个资源,如有这个资源就会直接返回给客户端。如果没有这个资源,CDN L1节点就会向CDN的L2节点去请求资源,L2节点如果有缓存该文件,那么L1向L2拿到数据以后就返回给客户端。如果L2节点也没有缓存该资源,那么CDN的L2节点会回源向源站去请求这个资源然后返回给客户端

How to transform IP addresses into geolocation in BigQuery standard SQL?

偶尔善良 提交于 2020-01-04 00:45:19
问题 So I have read https://cloudplatform.googleblog.com/2014/03/geoip-geolocation-with-google-bigquery.html But I was wondering if there was a #standardSQL way of doing it. So far, I have a lot of challenge converting PARSE_IP and NTH() since the suggested changes in the migration docs have limitations. Going from PARSE_IP(contributor_ip) to NET.IPV4_TO_INT64(NET.SAFE_IP_FROM_STRING(contributor_ip)) does not work for IPv6 IP addresses. Going from NTH(1, latitude) lat to latitude[SAFE_ORDINAL(1)]

How to transform IP addresses into geolocation in BigQuery standard SQL?

旧城冷巷雨未停 提交于 2020-01-04 00:44:47
问题 So I have read https://cloudplatform.googleblog.com/2014/03/geoip-geolocation-with-google-bigquery.html But I was wondering if there was a #standardSQL way of doing it. So far, I have a lot of challenge converting PARSE_IP and NTH() since the suggested changes in the migration docs have limitations. Going from PARSE_IP(contributor_ip) to NET.IPV4_TO_INT64(NET.SAFE_IP_FROM_STRING(contributor_ip)) does not work for IPv6 IP addresses. Going from NTH(1, latitude) lat to latitude[SAFE_ORDINAL(1)]

How to transform IP addresses into geolocation in BigQuery standard SQL?

一笑奈何 提交于 2020-01-04 00:44:17
问题 So I have read https://cloudplatform.googleblog.com/2014/03/geoip-geolocation-with-google-bigquery.html But I was wondering if there was a #standardSQL way of doing it. So far, I have a lot of challenge converting PARSE_IP and NTH() since the suggested changes in the migration docs have limitations. Going from PARSE_IP(contributor_ip) to NET.IPV4_TO_INT64(NET.SAFE_IP_FROM_STRING(contributor_ip)) does not work for IPv6 IP addresses. Going from NTH(1, latitude) lat to latitude[SAFE_ORDINAL(1)]

IP address for testing MaxMind GeoIP DB

谁说我不能喝 提交于 2020-01-03 14:27:08
问题 I'm experimenting with the MaxMind GeoIP (lite) DB. Part of this is trying to see if I can make solid unittests. For unittests I'd need to have some IP addresses I can rely on sending the same information always. Most IP addresses will move around, and I'm assuming they're even more fluid in a GeoIP database, but are there some IP addresses I can reasonably rely on (for whatever reason)? 回答1: Martijn, You can use the Pingdom probe servers IP address as reference. It is physical server running

How to Convert a Maxmind .MMDB to .DAT?

为君一笑 提交于 2020-01-02 00:14:07
问题 How to convert MaxMinds MMDB GeoIP to DAT format so that I can use with modsecurity+Apache. Modsecurity supports only DAT format. 回答1: As of February 2019, the following Python script is the best option for converting GeoIP2 MMDB format to legacy .dat format: https://github.com/sherpya/geolite2legacy Using this script, somebody has done the conversion and made the resulting .dat files available for download: https://www.miyuru.lk/geoiplegacy 回答2: The Legacy GeoIP builds (.dat) are not going

Get user geolocated country name in Woocommerce 3

二次信任 提交于 2020-01-01 03:37:07
问题 I would like to add "We ship to {country name} " in woocommerce header based on user geoip country name? I would like to Write an html content in the header of my woocommerce store, Such as We ship to "Your Country name" . Any help will be really appreciated? I have woocommerce geolocation enabled already. 回答1: You can make a custom function based on WC_Geolocation Class this way: function get_user_geo_country(){ $geo = new WC_Geolocation(); // Get WC_Geolocation instance object $user_ip =