代码之家  ›  专栏  ›  技术社区  ›  xRobot

通过API获取当前天气的最佳方法?

  •  11
  • xRobot  · 技术社区  · 14 年前

    通过API获取当前天气的最佳方法是什么?

    5 回复  |  直到 14 年前
        1
  •  3
  •   hydrogen    14 年前

    Global Weather SOAP Webservice API

    使用PHP(在php.ini文件):

    $client = new SoapClient("http://www.webservicex.net/globalweather.asmx?wsdl");
    $params = new stdClass;
    $params->CityName= 'Auckland';
    $params->CountryName= 'New Zealand';
    $result = $client->GetWeather($params);
    // Check for errors...
    $weatherXML = $result->GetWeatherResponse;
    

        2
  •  2
  •   Seth    14 年前

    尝试 Services_Weather 在梨上。它做全球天气,梅塔等。

        3
  •  1
  •   iwasrobbed    12 年前

    我做了一个 Weather API 这个api使用起来非常简单,因为我们使用了当今流行的标准,比如JSON和REST。

    如果你喜欢,请试穿一下 mashape

        4
  •  1
  •   Iggy    11 年前

    Programmable Web 有一个 list of Weather API's . 他们的目录中列出了26个天气api。更受欢迎的服务将有公共平台的库,因此可以在那里寻找php库。

        5
  •  0
  •   kevnk    10 年前

    Weather Underground (wunderground.com) 从一个链接上找到的天气网的页脚。

    免费: 花0美元,你每天可以得到500个API调用,或者每分钟10个API调用

    注: 先注册一个账户效果更好,