【发布时间】:2010-12-06 12:56:56
【问题描述】:
有人知道 Google 的 API 将提供的所有可能的天气情况吗?
我必须将我的图标与预测相匹配,但我找不到条件列表。
【问题讨论】:
有人知道 Google 的 API 将提供的所有可能的天气情况吗?
我必须将我的图标与预测相匹配,但我找不到条件列表。
【问题讨论】:
我发现这个列表看起来比我见过的任何其他列表都更完整
http://dennisdel.com/content/conditions.xml(不再提供(2016 年 1 月))
<conditions>
<type>PARTLY SUNNY</type>
<type>SCATTERED THUNDERSTORMS</type>
<type>SHOWERS</type>
<type>SCATTERED SHOWERS</type>
<type>RAIN AND SNOW</type>
<type>OVERCAST</type>
<type>LIGHT SNOW</type>
<type>FREEZING DRIZZLE</type>
<type>CHANCE OF RAIN</type>
<type>SUNNY</type>
<type>CLEAR</type>
<type>MOSTLY SUNNY</type>
<type>PARTLY CLOUDY</type>
<type>MOSTLY CLOUDY</type>
<type>CHANCE OF STORM</type>
<type>RAIN</type>
<type>CHANCE OF SNOW</type>
<type>CLOUDY</type>
<type>MIST</type>
<type>STORM</type>
<type>THUNDERSTORM</type>
<type>CHANCE OF TSTORM</type>
<type>SLEET</type>
<type>SNOW</type>
<type>ICY</type>
<type>DUST</type>
<type>FOG</type>
<type>SMOKE</type>
<type>HAZE</type>
<type>FLURRIES</type>
<type>LIGHT RAIN</type>
<type>SNOW SHOWERS</type>
<type>ICE/SNOW</type>
<type>WINDY</type>
<type>SCATTERED SNOW SHOWERS</type>
</conditions>
编辑
这里根据原列表新增了一个:
https://gist.github.com/806934
它从列表中删除这些
<type>ICE/SNOW</type>
<type>WINDY</type>
<type>SCATTERED SNOW SHOWERS</type>
并补充:
<type>HAIL</type>
无论如何使用所有这些可能不会有什么坏处
【讨论】:
有人提到:http://www.blindmotion.com/?p=73 虽然它可能不完整,因为它不是由 Google 发布的。不过,它可能涵盖了大约 99% 的情况,除非 Google 工作人员对天气 api 进行随机增强和发布。
编辑:
blindmotion.com 出现了,互联网存档有页面内容:http://web.archive.org/web/20111001141159/http://www.blindmotion.com/2009/03/google-weather-api-images/。 (注意,从 2009 年开始)
https://gist.github.com/bzerangue/806934(由 Vijay 提供,列在下面的答案中)可能是一个更新的列表
【讨论】:
该链接对我来说已损坏。这是我在另一个论坛上找到的列表:
"Clear
Cloudy
Fog
Haze
Light Rain
Mostly Cloudy
Overcast
Partly Cloudy
Rain
Rain Showers
Showers
Thunderstorm
Chance of Showers
Chance of Snow
Chance of Storm
Mostly Sunny
Partly Sunny
Scattered Showers
Sunny"
【讨论】:
这是我能找到的最佳列表:http://www.blindmotion.com/?p=73
您可能需要考虑正式支持并记录在案的替代 API。 Yahoo! 的Weather RSS feed 是一个方便易用的API。我将National Weather Service's API 用于我的一个项目,因为我需要提取未来特定时间范围的预测,它让我能够以一种相当直接的方式做到这一点。
【讨论】:
我编译了这个,它拥有一切,到目前为止我认为我没有错过任何东西。
Clear
Sunny
Partly Sunny
Mostly Sunny
Scattered Thunderstorms
Showers
Scattered Showers
Rain and Snow
Overcast
Light Snow
Freezing Drizzle
Chance of Rain
Partly Cloudy
Mostly Cloudy
Chance of Storm
Rain
Chance of Snow
Cloudy
Mist
Storm
Thunderstorm
Chance of TStorm
Sleet
Snow
Icy
Dust
Fog
Smoke
Haze
Flurries
Light Rain
Snow Showers
Hail
【讨论】:
更多:雾、尘、冰、烟、雨夹雪
【讨论】: