需要客户端 API 来确定 IP 地址的地理位置
我需要 Java 或 Ruby 的客户端 API。我非常更喜欢需要这只是本地的。事实上,这甚至可能不是 IP,而更像是数据库导入。问题是我无法使用基于 Web 服务的服务,因为这对我来说 I/O 太大了。
注意:通过地理位置,我真正需要的最多只是国家/地区。我也接受实际的纬度/经度坐标。
I need a client side API in either Java or Ruby. I would much prefer need this to be LOCAL only. Infact this might not even be an IP, but more of a database import. The thing is that I cannot make use of a web service based one as that is too much heavy I/O for me.
Note: By geolocation, all I really need is country/region at best. I would accept actual lat/long cordinates as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
几个月前我一直在关注这些人: http://www.maxmind.com/app/geolitecountry
对于我有限的目的来说,这似乎还不错。
I was looking at these guys a couple months ago: http://www.maxmind.com/app/geolitecountry
It seemed OK, for my limited purposes.
快速谷歌搜索得到了这个结果:http://www.hostip.info/dl/index. html
我认为这就是您正在寻找的内容。
a quick google search yielded this result: http://www.hostip.info/dl/index.html
I think it is what you are looking for.
对于基于网络的搜索,您可以使用:http://code.google.com/apis/ajaxsearch/ 。您所要做的就是:
现在 Google 填充了一些 javascript 变量,并且在您的其他 js 脚本中您现在可以使用以下方式访问地理位置: google.loader.ClientLocation.address.city、google.loader.ClientLocation.address.region、google.loader .ClientLocation.地址.国家/地区。
对于非常粗略的本地解决方案,您可以在此处获取国家/地区的 IP 范围:http://www.countryipblocks。净/大陆/。您基本上可以将其存储在本地并引用它来获取粗略的地理位置。
For a web based one you can use: http://code.google.com/apis/ajaxsearch/. All you do is have:
and now Google populates some javascript variables and in your other js scripts you can now access geographic location using: google.loader.ClientLocation.address.city, google.loader.ClientLocation.address.region, google.loader.ClientLocation.address.country.
For a very rough and local solution you can get the IP ranges of countries here: http://www.countryipblocks.net/continents/. You can basically store this locally and reference it to get a rough geographic location.