기타 [re] 구글날씨API를 이용한 날씨정보유틸

2008.09.21 03:11

juro 조회 수:885

http://junelife.tistory.com/36http://www.google.co.kr/ig/api?weather=해당 시/군의 영문명
위 주소는 구글에서 제공하는 날씨 정보를 얻기 위한 날씨 API용 주소이다.
원하는 시/군의 영문명을 입력하면 XML형태의 데이터로 결과를 출력해준다.

예를 들어 대구의 날씨를 알고 싶다면 다음과 같이 입력해주면
1. http://www.google.co.kr/ig/api?weather=Daegu
2. http://www.google.co.kr/ig/api?weather=Taegu
1,2번 아무거나 넣으면 된다. 내가 알기론 2번의 영문명은 예전에 사용하던 것이고, 1번이 변경된 영문명인 걸로 안다.

결과는 다음과 같다.
----------------------------------------------------------------------

<xml_api_reply version="1">

<weather module_id="0" tab_id="0">

<forecast_information>

<city data="Daegu"/>

<postal_code data="Daegu"/>

<latitude_e6 data=""/>

<longitude_e6 data=""/>

<forecast_date data="2008-08-20"/>

<current_date_time data="2008-08-20 06:00:00 +0000"/>

<unit_system data="SI"/>

</forecast_information>

<current_conditions>

<condition data="대체로 흐림"/>

<temp_f data="87"/>

<temp_c data="31"/>

<humidity data="습도: 24%"/>

<icon data="/images/weather/mostly_cloudy.gif"/>

<wind_condition data="바람: 북서풍, 10 km/h"/>

</current_conditions>

<forecast_conditions>

<day_of_week data="오늘"/>

<low data="21"/>

<high data="29"/>

<icon data="/images/weather/mostly_sunny.gif"/>

<condition data="대체로 맑음"/>

</forecast_conditions>

<forecast_conditions>

<day_of_week data="목"/>

<low data="22"/>

<high data="29"/>

<icon data="/images/weather/mostly_sunny.gif"/>

<condition data="대체로 맑음"/>

</forecast_conditions>

<forecast_conditions>

<day_of_week data="금"/>

<low data="23"/>

<high data="30"/>

<icon data="/images/weather/rain.gif"/>

<condition data="비"/>

</forecast_conditions>

<forecast_conditions>

<day_of_week data="토"/>

<low data="23"/>

<high data="31"/>

<icon data="/images/weather/mostly_sunny.gif"/>

<condition data="대체로 맑음"/>

</forecast_conditions>

</weather>

</xml_api_reply>
----------------------------------------------------------------------


국내 주요 시/군 영문명
----------------------------------------------------------------------

-. 서울
   - http://www.google.co.kr/ig/api?weather=Seoul

.- 대구
   - http://www.google.co.kr/ig/api?weather=Taegu
   - http://www.google.co.kr/ig/api?weather=Daegu

-. 부산
   - http://www.google.co.kr/ig/api?weather=Pusan
   - http://www.google.co.kr/ig/api?weather=Busan

-. 광주
   - http://www.google.co.kr/ig/api?weather=Kwangju

-. 대전
   - http://www.google.co.kr/ig/api?weather=Daejeon
   - http://www.google.co.kr/ig/api?weather=Taejon

-. 전주
   - http://www.google.co.kr/ig/api?weather=Jeonju
   - http://www.google.co.kr/ig/api?weather=Chonju

-. 원주
   - http://www.google.co.kr/ig/api?weather=Wonju

-. 청주
   - http://www.google.co.kr/ig/api?weather=Cheongju

-. 충주
   - http://www.google.co.kr/ig/api?weather=Chungju

-. 포항
   - http://www.google.co.kr/ig/api?weather=Pohang

-. 성남
   - http://www.google.co.kr/ig/api?weather=Songnam

-. 수원
   - http://www.google.co.kr/ig/api?weather=Suwon

-. 상주
   - http://www.google.co.kr/ig/api?weather=Sangju

-. 김해
   - http://www.google.co.kr/ig/api?weather=Gimhae
  
-. 인천
   - http://www.google.co.kr/ig/api?weather=Incheon
   - http://www.google.co.kr/ig/api?weather=Inchon

-. 울산
   - http://www.google.co.kr/ig/api?weather=Ulsan

-. 창원
   - http://www.google.co.kr/ig/api?weather=Changwon

-. 천안
   - http://www.google.co.kr/ig/api?weather=Cheonan

-. 안양
   - http://www.google.co.kr/ig/api?weather=Anyang

-. 안산
   - http://www.google.co.kr/ig/api?weather=Ansan

-. 부천
   - http://www.google.co.kr/ig/api?weather=Bucheon
   - http://www.google.co.kr/ig/api?weather=Puchon

-. 춘천
   - http://www.google.co.kr/ig/api?weather=Chuncheon

-. 제주
   - http://www.google.co.kr/ig/api?weather=Jeju
   - http://www.google.co.kr/ig/api?weather=Cheju

-. 여수
   - http://www.google.co.kr/ig/api?weather=Yeosu
   - http://www.google.co.kr/ig/api?weather=Yosu

-. 안동
   - http://www.google.co.kr/ig/api?weather=Andong

-. 양산
   - http://www.google.co.kr/ig/api?weather=Yangsan

-. 태안
   - http://www.google.co.kr/ig/api?weather=Taean

-. 진주
   - http://www.google.co.kr/ig/api?weather=Chinju
   - http://www.google.co.kr/ig/api?weather=Jinju

-. 진해
   - http://www.google.co.kr/ig/api?weather=Chinhae

-. 의정부
   - http://www.google.co.kr/ig/api?weather=Uijongbu

-. 평택
   - http://www.google.co.kr/ig/api?weather=Pyongtaek

-. 오산
   - http://www.google.co.kr/ig/api?weather=Osan

-. 순천
   - http://www.google.co.kr/ig/api?weather=Sunchon

-. 당진
   - http://www.google.co.kr/ig/api?weather=Tangjin
   - http://www.google.co.kr/ig/api?weather=Dangjin

-. 마산
   - http://www.google.co.kr/ig/api?weather=Masan

-. 군산
   - http://www.google.co.kr/ig/api?weather=Kunsan
   - http://www.google.co.kr/ig/api?weather=Gunsan

-. 목포
   - http://www.google.co.kr/ig/api?weather=Mokpo

-. 동해
   - http://www.google.co.kr/ig/api?weather=Tonghae

-. 구미
   - http://www.google.co.kr/ig/api?weather=Gumi
   - http://www.google.co.kr/ig/api?weather=Kumi

-. 삼척
   - http://www.google.co.kr/ig/api?weather=Samchok

-. 용인
   - http://www.google.co.kr/ig/api?weather=Yongin

-. 거제
   - http://www.google.co.kr/ig/api?weather=Koje
----------------------------------------------------------------------




© juroweb 2003-2014. All rights reserved
log in