javascript 雅虎天气图标

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5435078/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 17:11:31  来源:igfitidea点击:

Yahoo Weather Icon

javascripthtmliconsweatheryahoo-weather-api

提问by Lenny Magico

Weather Icon

天气图标

Is there away to display just the Yahoo weather icon above on a webpage? I'm using geektool on my Mac and it can be displayed on my desktop but I'm wondering if it is possible to just have that icon in a webapge??? ANy ideas :)

是否可以在网页上仅显示上面的雅虎天气图标?我在我的 Mac 上使用 geektool,它可以显示在我的桌面上,但我想知道是否可以在网页中只显示那个图标???有任何想法吗 :)

回答by Ruslan Abuzant

Have you tried http://l.yimg.com/a/i/us/we/52/XX.gif

你试过http://l.yimg.com/a/i/us/we/52/XX.gif

where XX is your status code returned from the API?

XX 是您从 API 返回的状态代码?

Example: http://l.yimg.com/a/i/us/we/52/24.gif

示例:http: //l.yimg.com/a/i/us/we/52/24.gif

回答by naveen

Yes. The response of Yahoo Weather APIcontains an image that denotes the weather.

是的。Yahoo Weather API响应包含表示天气的图像。

The path to the current weather image is channel > item > description > img(inside CDATA)

当前天气图像的路径是channel > item > description > img(在 CDATA 内)

View the below responses in Firefox and then you can see those icons for yourself.

在 Firefox 中查看以下响应,然后您可以自己查看这些图标。

  1. New York City - http://weather.yahooapis.com/forecastrss?w=2459115
  2. Paris, France - http://weather.yahooapis.com/forecastrss?w=615702
  1. 纽约市 - http://weather.yahooapis.com/forecastrss?w=2459115
  2. 法国巴黎 - http://weather.yahooapis.com/forecastrss?w=615702

回答by Lenny Magico

I had anothet good look around and finaly found what I was looking for, this was exactly what I needed;

我四处看了看,终于找到了我要找的东西,这正是我所需要的;

http://blog.unijimpe.net/reporte-del-clima-en-php/

http://blog.unijimpe.net/reporte-del-clima-en-php/

The website is spanish but figured most of it out wiht google translator ;)

该网站是西班牙文,但大部分内容都是通过谷歌翻译器弄明白的;)