Yahoo Weather API 날씨

/*
전세계 60000곳에 해당하는 실시간 날씨정보를 가져와보자!
http://developer.yahoo.com/flash/ 에서 Web APIs Library 를 다운받자
astra-webapis-1.2.0.zip 를 압축을 풀고 Source 폴더 안의 com 폴더를 몽땅 fla파일이 있는 곳으로 복사한다.
한국의 날씨 지역코드 http://m.blog.naver.com/PostView.nhn?blogId=hkh51&logNo=140109513487
*/
import com.yahoo.webapis.weather.WeatherService; //날씨 정보 가져오는 객체
import com.yahoo.webapis.weather.events.WeatherResultEvent;

var ws:WeatherService = new WeatherService();
ws.addEventListener(WeatherResultEvent.WEATHER_LOADED, onComplete);
ws.getWeather(“KSXX0037”, “c”); // KSXX0037 : 서울, c : 섭씨

function onComplete(e:WeatherResultEvent):void
{
trace(e.data);
/* 원하는 정보만 가져오기 위해서 WeatherResultEvent.as 에 아래의 코드를 추가한다.
import com.yahoo.webapis.weather.Weather;
public function get weather():Weather
{
return _data as Weather;
}
*/
trace(“humidity : “+e.weather.current.atmosphere.humidity);
trace(“temperature : “+e.weather.current.temperature);
trace(“pressure : “+e.weather.current.atmosphere.pressure);
trace(“wind chill : “+e.weather.current.wind.chill);
trace(“wind speed : “+e.weather.current.wind.speed);
}
[참조 ] http://blog.naver.com/PostView.nhn?blogId=dimorin&logNo=90112969234