MSN天气API条件列表? [英] MSN weather API list of conditions?
问题描述
Microsoft 有一个与 Google 非常相似的天气 API(现在似乎完全失效了).我已将我的一个应用程序转换为他们的供稿,但我无法找到所有可能的天气条件的列表.
Microsoft has a weather API very similar to Google's (which now appears to be completely dead). I've converted one of my applications over to their feed, but I've been unable to find a list of all possible weather conditions.
Google 的天气 API 对此进行了很好的记录,但我找不到 MSN 天气 API 的条件列表.
This is documented fairly well for Google's weather API, but I can't find a list of conditions for the MSN weather API.
FWIW,使用 MSN 取回数据的示例 URL 是:
FWIW, an example URL to get data back using MSN is:
http://weather.service.msn.com/data.aspx?weadegreetype=F&culture=en-US&weasearchstr=Chicago,IL(服务不再可用(2016 年 1 月))
http://weather.service.msn.com/data.aspx?weadegreetype=F&culture=en-US&weasearchstr=Chicago,IL (service not available anymore (Jan 2016))
谁能解释一下可能的情况?我需要它们,以便我可以将条件文本转换为图标.
Can anyone shed some light on the possible conditions? I need them so that I can convert the condition text to an icon instead.
推荐答案
我决定走一条稍微不同的路线,并根据提供的图标(skycode 和 skycodeday强>) 来自 XML.
I decided to go a slightly different route and figure out conditions based on the icon provided (skycode and skycodeday) from the XML.
这是我想出的清单.希望对其他人从 Google 的天气 API 迁移有所帮助:
Here is a list of what I came up with. Hopefully it will be helpful for others in migrating from Google's weather API:
- 0, 1 ,2, 3 ,4, 17, 35 - 雷暴
- 5 - 雨雪混合
- 6 - 雨夹雪/雪混合
- 7 - 雨/雪/雨夹雪
- 8,9 - 冰冷
- 10 - 雨雪混合
- 11 - 小雨
- 12 - 下雨
- 13 - 小雪
- 14,16,42,43 - 雪
- 15 - 暴雪
- 18,40 - 阵雨
- 19 - 灰尘
- 20 - 雾
- 21 - 阴霾
- 22 - 烟
- 23,24 - 有风
- 25 - 寒冷
- 26 - 多云
- 27,29,33 - 多云(夜间)
- 28,30,34 - 多云
- 31 - 晴朗(夜间)
- 32 - 清除
- 36 - 热门
- 37,38 - 分散的雷暴
- 39 - 零星阵雨
- 41 - 零星阵雨
- 44 - 不适用
- 45 - 零星阵雨(夜间)
- 46 - 零星阵雪(夜间)
- 47 - 分散的雷暴(夜间)
这篇关于MSN天气API条件列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!