geoip

Associate IP addresses with countries [closed]

痞子三分冷 提交于 2019-12-29 13:30:34
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I want to show country flag depending on ip address I receive at server side. Are fixed ip addresses are assigned to countries ? Where can I get database for ip address to country mapping ? 回答1: Take a look at the following: IP address geolocation SQL database Geo Locate IP Address XML API Whois Map Country

How to find the geoip location for all users in Nodejs

拈花ヽ惹草 提交于 2019-12-29 07:19:13
问题 I have a requirement where i have to find the geoip location of the users. I have used the code where i store the address of the user in database and then display the geoip location of that user.Now suppose the users changed his location to some other place.If the user now logs in from that region or country, how should i display the geoip of that user. The code that i use is: geo.geocoder(geo.google, address, sensor,function(formattedAddress, latitude, longitude) { console.log("Formatted

【Java】通过ip地址获取详细地域信息(不通过API使用本地库)

£可爱£侵袭症+ 提交于 2019-12-29 01:28:43
MaxMind GeoIP2 服务能识别互联网用户的地点位置与其他特征,应用广泛,包括个性化定制内容、诈欺检测、广告定向、网站流量分析、执行规定、地理目标定位、地理围栏定位 (geo-fencing)以及数字版权管理。目前使用 GeoIP 更多是配合Nginx或Apache服务器进行日志分析获取网站访问量地域分布状况。 GeoIP 分为商业版和免费版,免费版比商业版精度差了许多,经测试对于城市定位确实有差距,能否接受看你的精度要求!(老板说免费的可以了,哈哈) 下载GeoIP2的库,这个库是经常更新的,如果数据要求很高的,需要经常更新(我们不高,预计一年一次) 官网下载地址https://dev.maxmind.com/geoip/geoip2/geolite2/ 但是好像网站不太稳定,我这边3个都下载好了,可【点击下载】 关于Java如何使用 不用担心,已经有开源库,maven下载一个 <dependency> <groupId>com.maxmind.geoip2</groupId> <artifactId>geoip2</artifactId> <version>2.12.0</version> </dependency> 没有maven,怎么办?不怕,我上传了,可【点击下载】 使用用到的工具类 import com.maxmind.geoip2.DatabaseReader

php geo ip loc does not work

痞子三分冷 提交于 2019-12-25 04:51:27
问题 http://chir.ag/projects/geoiploc/ Hello, I am trying to set this up, but whenever I use include("geoiploc.php"); the page is blank and whenever I remove include("geoiploc.php"); I only see my IP address. I've uploaded geoiploc.php and index.php to a webhost that can run PHP. If there is ANY other easier way to show country name by IP or any other way, which is it? Please I need this fast So as I said, it only shows my IP whenever I remove include("geoiploc.php"); why? You need this library:

Installing MaxMind GeoIP ruby library on heroku

我只是一个虾纸丫 提交于 2019-12-24 19:30:01
问题 I have a Rails app running on heroku. Now I want to run a rake task (which uses a model of my rails app) and geo-tag each record using the MaxMind GeoIP database (http://www.maxmind.com/app/geolite). Using this database in a Ruby application involves : Building it's C-API (http://www.maxmind.com/app/c) and then Build the Ruby bindings for that (http://www.maxmind.com/app/ruby). I could do this on my local machine and successfully get the country codes from IP addresses. However I do not know

How to add dependencies for maxmind geoip2 eclipse

谁都会走 提交于 2019-12-24 14:11:56
问题 I'm trying to use MaxMind's GeoIP2 database, I've added the jar to my Java build path and configured it with Javadoc and source but when I run the program I get a NoClassDefFound error, which according to this stack overflow answer is because I need to add the dependencies, but I have no clue how to add them in eclipse, I tried extracting the jar files and adding them to the build path but that didn't work, how do I do this in eclipse? Thanks for any help. 回答1: In eclipse you have to create a

geoip zip code query

风格不统一 提交于 2019-12-24 09:24:09
问题 I have downloaded the csv geoip lite from http://www.maxmind.com/app/geolitecountry. I imported that data into my db as the following tables: Blocks: startIP, endIP, locid. Location: locid, country, region, city, postalcode, lat, long, met, areacode. the code that creates the IPnum is: <? $ip =$_SERVER['REMOTE_ADDR']; list($w, $x, $y, $z) = explode('.', $ip); $one = 16777216* $w; $two = 65536* $x ; $three = 256*$y; $ipnum = $one + $two+ $three + $z; ?> then my query is: SELECT postalcode FROM

MaxMind GeoIP API: fseek() [function.fseek]: stream does not support seeking in geoip.inc

浪尽此生 提交于 2019-12-23 06:44:11
问题 I'm using MaxMind's GeoIP service as such: <?php include("geoip/geoip.inc"); include("geoip/geoipcity.inc"); include('geoip/geoipregionvars.php'); $gi = geoip_open("http://watchandrepeat.com/GeoLiteCity.dat", GEOIP_STANDARD); ?> It turns out that the geopi_open API uses fseek, and it is failing on my web server: Warning: fseek() [function.fseek]: stream does not support seeking in /hsphere/local/home/yudaluz/watchandrepeat.com/geoip/geoip.inc on line 319 As of this writing, you can see it

Strange slow queries with MySQL

喜你入骨 提交于 2019-12-23 02:13:50
问题 I have table A which contains IP ranges (columns startIpNum, endIpNum, locId) and table A_location (column locaId and other not important columns). There are following indexes - startIpNum and endIpNum on A, and locId on A_location. The problem is that sometimes queries are performed very slowly. Below there is a mysql-slow logfile, which contains two queries, bith of them return nothing. # Time: 140001 21:18:45 # User@Host: root[root] @ localhost [127.0.0.1] # Query_time: 0.023001 Lock_time:

Error installing geoip_city gem

故事扮演 提交于 2019-12-23 01:21:27
问题 I keep getting an error when trying to install the geoip_city gem. I've already installed the GeoIP C library to /opt/GeoIP, but the gem doesn't seem to pick it up. I've tried: sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP sudo gem install geoip_city -- --with-geoip-lib=/opt/GeoIP/lib sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP --with-geoip-lib=/opt/GeoIP/lib all of which output this error: Building native extensions. This could take a while... ERROR: Error