itommy
V2EX  ›  问与答

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

  •  
  •   itommy · Apr 22, 2011 · 5166 views
    This topic created in 5691 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
    benzhe
    Apr 22, 2011
    1
    随便用“localtion ip api”搜了一下,找到挺多提供类似api的服务,你可以试一下这个,只提供localtion:
    http://ipinfodb.com/ip_location_api.php

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

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

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