<script type="text/javascript">
/** @author: Rilwis */
function showWeatherCallback(d){var c=d.query.results.weather.rss.channel,a=c.item.description.match(/http:\/\/[^"']*/),b='<img style="vertical-align:bottom" height="52" width="52" src="'+a+'" /> <span style="font-size:44px">'+c.item.condition.temp+"°C</span><br /><strong>Độ ẩm:</strong> "+c.atmosphere.humidity+"%<br /><strong>Tốc độ gió:</strong> "+c.wind.speed+" km/h<br/>";document.write(b)}function showWeather(a){var c="http://query.yahooapis.com/v1/public/yql?q=",d='use "http://github.com/yql/yql-tables/raw/master/weather/weather.bylocation.xml" as we;select * from we where location="'+a+'" and unit="c"',b=c+encodeURIComponent(d)+"&format=json&diagnostics=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=showWeatherCallback";document.write('<script type="text/javascript" src="'+b+'"><\/script>')};
</script>
<div id="weather-code1k-com">
<h4>Thời tiết TP Hồ Chí Minh</h4>
<script type="text/javascript">
showWeather('hochiminh, vietnam');
</script>
</div>
Theo : code1k.com
0 nhận xét:
Đăng nhận xét