V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
itommy
V2EX  ›  问与答

那种可以显示用户当地location, weather信息的功能是怎么做的?

  •  
  •   itommy · 2011-04-22 02:22:59 +08:00 · 4291 次点击
    这是一个创建于 4768 天前的主题,其中的信息可能已经有所发展或是发生改变。
    例子: 登录google.com或者bing.com的时候,右上角会显示你的location. (我人在米国,不知到国内有没有这样的)

    应该是一种什么method可以抓到用户的ip或者zip, 然后用google或者yahoo api 就可以弄到

    google了一堆没用的,估计是不够专业的术语,所以找不到好results. 这里牛人多,这里问方便。 :)
    7 条回复    1970-01-01 08:00:00 +08:00
    benzhe
        1
    benzhe  
       2011-04-22 02:30:35 +08:00
    随便用“localtion ip api”搜了一下,找到挺多提供类似api的服务,你可以试一下这个,只提供localtion:
    http://ipinfodb.com/ip_location_api.php

    可以用这个apikey,刚申请的:
    dce2c2b416c91e2319f7eff12ea95155d1310272e791083f5d84ab98c4bd5a31
    itommy
        2
    itommy  
    OP
       2011-04-22 10:29:10 +08:00
    @benzhe :) 谢谢 我待会去试试!
    itommy
        3
    itommy  
    OP
       2011-04-22 10:46:05 +08:00
    @benzhe 不太准 我在西雅图的星巴克,他给我弄到波特兰(隔壁州)去了. :(

    你试了没? 准确率怎样?
    benzhe
        4
    benzhe  
       2011-04-22 11:09:27 +08:00
    est
        5
    est  
       2011-04-22 11:13:51 +08:00
    google "geoip service"

    AFAIK porn sites has the best accuracy and updates IP faster than the rest of industry
    willwen
        6
    willwen  
       2011-04-22 11:20:54 +08:00
    用Geolocation或者Google Location之类的API先获取经纬度,然后通过第三方API获取当地信息。应该是这样的
    fankay
        7
    fankay  
       2011-04-22 13:15:15 +08:00
    试试腾讯的http://fw.qq.com/ipaddress
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3846 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 00:52 · PVG 08:52 · LAX 17:52 · JFK 20:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.