itommy
V2EX  ›  问与答

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

  •  
  •   itommy · Apr 22, 2011 · 4994 views
    This topic created in 5587 days ago, the information mentioned may be changed or developed.
    例子: 登录google.com或者bing.com的时候,右上角会显示你的location. (我人在米国,不知到国内有没有这样的)

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

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

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

    你试了没? 准确率怎样?
    benzhe
        4
    benzhe  
       Apr 22, 2011
    est
        5
    est  
       Apr 22, 2011
    google "geoip service"

    AFAIK porn sites has the best accuracy and updates IP faster than the rest of industry
    willwen
        6
    willwen  
       Apr 22, 2011
    用Geolocation或者Google Location之类的API先获取经纬度,然后通过第三方API获取当地信息。应该是这样的
    fankay
        7
    fankay  
       Apr 22, 2011
    试试腾讯的http://fw.qq.com/ipaddress
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2500 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 00:44 · PVG 08:44 · LAX 17:44 · JFK 20:44
    ♥ Do have faith in what you're doing.