컴퓨터 winXplanet에 날씨를 표시하는 Perl Script
2008.05.30 18:03
winXplanet에다 일기예보를 그려주던 태미니님의 프로그램이 맛이 가버렸다. 사이트의 문제였을까.
갑자기 너무 허전해진 지구의 모습을 다시 채우고 싶어서 이리저리 궁리해보다 결국 Perl Script로
만들어버렸다.
0. 아래의 스크립트 파일을들을 C:\Program Files\winXPlanet\xplanet 폴더에 저장할 것.
(경로가 다른 사람들은 거기에 저장할 것. 예: D:\Programs\winXplanet\xplanet 등등)
1. newWeather.bat은 Perl Script를 일괄 실행하는 Batch 파일. 첫번째, 두 번째 줄의 드라이브명 (C:)과
파일 경로는(cd C:\Program Files\winXPlanet\xplanet) 자기가 저장한 위치로 변경할 것.
2. cities.txt는 날씨 정보를 보고 싶은 도시의 Region Code와 자기가 지정한 도시명을 : 로 구분해
나열한 정보성 파일. Region Code는 weather.yahoo.com 에서 참조.
3. getWeatherMap.pl는 Perl Script로 cities.txt 파일을 읽어서 http://xoap.weather.com/ 에다 던져서
XML로 된 날씨 정보를 읽어서 Print 함. getWeatherMap.pl 을 실행할 때 > 기호로 저장할 파일명을
지정해야 함. 안그러면 그냥 화면상에 출력되고는 사라짐.
(newWeather.bat의 둘째 줄을 보면 getWeatherMap.pl cities.txt > initWeathers.xml 라고 되어 있다.
getWeatherMap.pl을 실행시키되 cities.txt를 읽어서 initWeathers.xml로 출력하라는 뜻임)
4. 3에서 생성된 initWeathers.xml 파일을 읽어서 winXplanet 형식으로 변환해 weathermapMarker 파일을
생성함.
(newWeather.bat의 셋째 줄을 보면 weatherMap.pl initWeathers.xml > weathermapMarker 라고 되어 있다.
weatherMap.pl을 실행시키되 initWeathers.xml 를 읽어서 weathermapMarker로 출력하라는 뜻임)
5. weathermapMarker_RanomA 를 winXplanet 프로그램에 추가할 것.
(Parameter 탭 --> Xplanet Configuration 탭 --> Add Marker 로 추가. Apply changes로 반영.
Save config 해야 다음에도 가능함)
newWeather.bat
----------------------------------
@echo off
c:
cd C:\Program Files\winXPlanet\xplanet
getWeatherMap.pl cities.txt > markers\initWeathers.xml
weatherMap.pl markers\initWeathers.xml > markers\weathermapMarker_RanomA
cities.txt
---------------------------------------------------------------------------------
AEXX0001:U.A.E
ASXX0002:Alice Springs
ASXX0032:다윈
ASXX0089:Perth
ASXX0092:Port Hedland
ASXX0112:시드니
BGXX0003:다카
BMXX0005:양곤
BRXX0201:리오데자네이로
CAXX0518:밴쿠버
CDXX0003:은자메나
CGXX0005:킨샤샤
CHXX0008:북경
CHXX0017:충칭
CHXX0049:홍콩
CHXX0116:상해
CHXX0141:시안
EGXX0004:카이로
FRXX0076:파리
IDXX0005:발리
INXX0012:뱅갈로어
INXX0096:뉴델리
IRXX0018:테헤란
ITXX0067:로마
IVXX0001:아비쟌
JAXX0067:오끼나와
JAXX0078:삿뽀로
JAXX0085:도꾜
KEXX0009:케냐
KSXX0037:서울
LYXX0004:가트
MGXX0003:울란바토르
MXDF0132:멕시코씨티
MYXX0008:쿠알라룸푸르
#NPXX0002:카트만두
PEXX0011:Lima
PKXX0006:Islamabad
RPXX0017:마닐라
RSXX0063:모스크바
RSXX0122:야쿠츠크
RSXX0258:톰스크
SFXX0023:요하네스버그
SPXX0047:라스팔마스
SUXX0002:카르툼
THXX0002:방콕
TUXX0014:이스탄불
UKXX0085:런던
USAK0012:앵커리지
USCA0638:L.A.
USFL0316:마이애미
USGU0002:괌
USHI0026:호놀룰루
USNY0996:뉴욕
ZAXX0004:루사카
PPXX0004:Port Moresby
IDXX0002:Ambon
IDXX0089:Jayapura
BXXX0001:브루나이
#NZXX0049:웰링턴
#VMXX0006:하노이
#BMXX0001:만달레이
#IZXX0008:바그다드
#USMP0001:싸이판
#IDXX0022:자카르타
#IDXX0089:자야푸라
USPW0001:Palau
USWQ0002:Wake섬
USMH0003:Ebeye
TVXX0001:Tuvalu
#ASXX0016:브리즈번
ASXX0194:브리즈번
#ASXX0117:타운스빌
ASXX0020:Cairns
getWeatherMap.pl
----------------------------------
#!/usr/bin/perl
use LWP::Simple;
my $region_code;
my $region_name;
my $url;
while(<>)
{
$line = $_;
if($line =~ m/([^:]*):(.*)/)
{
$region_code = $1;
$region_name = $2;
}
$url = "http://xoap.weather.com/weather/local/" . $region_code . "?unit=m&dayf=1";
$html = get( $url );
$html =~ s/<dnam>([^<,]*).*<\/dnam>/<dnam>$region_name<\/dnam>/g;
print "$html";
}
weatherMap.pl
----------------------------------
#!/usr/bin/perl
use Encode; use strict; use warnings;
my $line;
my $lat;
my $lon;
my $dnam;
my $day_night;
my $day_icon;
my $day_hi;
my $day_low;
my $day_title;
my $night_icon;
my $night_hi;
my $night_low;
my $night_title;
my $icon;
my $hi;
my $low;
my $title;
my $color;
my $flag;
my $print_out1;
my $print_out2;
printf("-90 0 image=none\n");
while(<>)
{
$line = $_;
if($line =~ m/<dnam>([^<,]*).*<\/dnam>/)
{
$dnam = $1;
$flag = 1;
}
if($line =~ m/<lat>([^<]*)<\/lat>/)
{
$lat = $1;
}
if($line =~ m/<lon>([^<]*)<\/lon>/)
{
$lon = $1;
}
if($line =~ m/<hi>([^<]*)<\/hi>/)
{
$hi = $1;
if($hi =~ m/(-*\d{2})/)
{
$hi = $1;
}
elsif($hi =~ m/(-*)(\d)/)
{
$hi = $1 . "0" . $2;
}
if($hi eq "N/A")
{
$color = "Gray";
$hi = " ";
}
elsif($hi gt 30)
{
$color = "Red";
}
elsif($hi gt "20" && $hi le "30")
{
$color = "HotPink";
}
elsif($hi gt "10" && $hi le "20")
{
$color = "plum";
}
elsif($hi gt "0" && $hi le "10")
{
$color = "LightSteelBlue";
}
else
{
$color = "white";
}
}
if($line =~ m/<low>([^<]*)<\/low>/)
{
$low = $1;
if($low =~ m/(-*\d{2})/)
{
$low = $1;
}
elsif($low =~ m/(-*)(\d)/)
{
$low = $1 . "0" . $2;
}
if($low eq "N/A")
{
$low = " ";
}
if($hi eq " ")
{
if($low gt 30)
{
$color = "Red";
}
elsif($low gt "20" && $low le "30")
{
$color = "HotPink";
}
elsif($low gt "10" && $low le "20")
{
$color = "plum";
}
elsif($low gt 0 && $low le 10)
{
$color = "LightSteelBlue";
}
else
{
$color = "white";
}
}
}
if($line =~ m/<icon>([^<]*)<\/icon>/)
{
$icon = $1;
}
if($line =~ m/<t>([^<]*)<\/t>/)
{
if($flag > 0)
{
$title = $1;
if($title eq "N/A")
{
$title = " ";
$flag++;
}
else
{
$title =~ s/(Mon|Thu|Wed|Thr|Fri|Sat|Sun) +(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) +(\d{1,2}) +(\d{4}) +(\d{2}:\d{2}) +(AM|PM) +([A-Z]+)/$4-$2-$3/ig;
$title =~ s/-Jan-/-01-/ig;
$title =~ s/-Feb-/-02-/ig;
$title =~ s/-Mar-/-03-/ig;
$title =~ s/-Apr-/-04-/ig;
$title =~ s/-May-/-05-/ig;
$title =~ s/-Jun-/-06-/ig;
$title =~ s/-Jul-/-07-/ig;
$title =~ s/-Aug-/-08-/ig;
$title =~ s/-Sep-/-09-/ig;
$title =~ s/-Oct-/-10-/ig;
$title =~ s/-Nov-/-11-/ig;
$title =~ s/-Dec-/-12-/ig;
$title =~ s/AM/오전/ig;
$title =~ s/PM/오후/ig;
$title =~ s/(.*) Until (.*)/$2까지 $1/ig;
$title =~ s/(.*) For (\w+)/$1 For $dnam/ig;
$title =~ s/(.*) For (.*)/$2에 $1/ig;
$title =~ s/Few (.*)/$1 약간/ig;
$title =~ s/(.*) Late/늦게 $1/ig;
$title =~ s/(.*) Early/일찍 $1/ig;
$title =~ s/Widespread Dust/황사 현상/ig;
$title =~ s/Waxing Gibbous/오른쪽이 뚱뚱한 달/ig;
$title =~ s/Waxing Crescent/오른쪽이 홀죽한 초승달/ig;
$title =~ s/Waning Gibbous/왼쪽부분이 뚱뚱한 달/ig;
$title =~ s/Waning Crescent/왼쪽이 홀죽한 초승달/ig;
$title =~ s/Flash Flood/기습호우/ig;
$title =~ s/Winter Weather/한파/ig;
$title =~ s/Snow Showers*/눈보라/ig;
$title =~ s/Rain and Snow/진눈깨비/ig;
$title =~ s/Partly Cloudy/약간 흐림/ig;
$title =~ s/Moon Visibility/달 가시도/ig;
$title =~ s/Last quarter/하현달/ig;
$title =~ s/Isolated/국지성/ig;
$title =~ s/New Moon/초승달/ig;
$title =~ s/Full Moon/보름달/ig;
$title =~ s/Freezing Rain/착빙성 비/ig;
$title =~ s/First Quarter/상현달/ig;
$title =~ s/Few Showers*/매우 적은 비/ig;
$title =~ s/Windy/폭풍/ig;
$title =~ s/Wind/바람/ig;
$title =~ s/T-Storms/뇌우/ig;
$title =~ s/Sunny/화창/ig;
$title =~ s/Sun/해/ig;
$title =~ s/Snow/눈/ig;
$title =~ s/Showers*/소나기/ig;
$title =~ s/Scattered/산발성/ig;
$title =~ s/Rain/비/ig;
$title =~ s/Partly/약간/ig;
$title =~ s/Overcast/흐림/ig;
$title =~ s/Mostly/대체로/ig;
$title =~ s/Mist/옅은 안개/ig;
$title =~ s/Light/적은 비/ig;
$title =~ s/Humidity/습도/ig;
$title =~ s/Hot/더움/ig;
$title =~ s/Heavy/강한/ig;
$title =~ s/Dense/짙은/ig;
$title =~ s/Haze/연무/ig;
$title =~ s/Fog/안개/ig;
$title =~ s/Fair/맑음/ig;
$title =~ s/Drizzle/이슬비/ig;
$title =~ s/Cloudy/흐림/ig;
$title =~ s/Clouds/구름/ig;
$title =~ s/Clear/쾌청/ig;
$title =~ s/Flood/홍수/ig;
$title =~ s/Coastal/홍수/ig;
$title =~ s/Flash/기습/ig;
$title =~ s/Warning/경보/ig;
$title =~ s/Advisory/주의보/ig;
$title =~ s/Watch/주의보/ig;
$flag = 0;
$print_out1 = sprintf("%s %s \"%s\" align=Above color=LightBlue image=WeatherMapImages\\%s.png\n", $lat, $lon, $dnam, $icon);
if($hi eq " ")
{
$print_out2 = sprintf("%s %s \"%s/%s\" align=Below color=%s image=WeatherMapImages\\%s.png\n", $lat, $lon, $title, $low, $color, $icon);
}
elsif($low eq " ")
{
$print_out2 = sprintf("%s %s \"%s/%s\" align=Below color=%s image=WeatherMapImages\\%s.png\n", $lat, $lon, $title, $hi, $color, $icon);
}
else
{
$print_out2 = sprintf("%s %s \"%s/%s ~ %s\" align=Below color=%s image=WeatherMapImages\\%s.png\n", $lat, $lon, $title, $low, $hi, $color, $icon);
}
Encode::from_to ($print_out1, "euc-kr", "utf-8");
Encode::from_to ($print_out2, "euc-kr", "utf-8");
print($print_out1);
print($print_out2);
}
}
}
}
갑자기 너무 허전해진 지구의 모습을 다시 채우고 싶어서 이리저리 궁리해보다 결국 Perl Script로
만들어버렸다.
0. 아래의 스크립트 파일을들을 C:\Program Files\winXPlanet\xplanet 폴더에 저장할 것.
(경로가 다른 사람들은 거기에 저장할 것. 예: D:\Programs\winXplanet\xplanet 등등)
1. newWeather.bat은 Perl Script를 일괄 실행하는 Batch 파일. 첫번째, 두 번째 줄의 드라이브명 (C:)과
파일 경로는(cd C:\Program Files\winXPlanet\xplanet) 자기가 저장한 위치로 변경할 것.
2. cities.txt는 날씨 정보를 보고 싶은 도시의 Region Code와 자기가 지정한 도시명을 : 로 구분해
나열한 정보성 파일. Region Code는 weather.yahoo.com 에서 참조.
3. getWeatherMap.pl는 Perl Script로 cities.txt 파일을 읽어서 http://xoap.weather.com/ 에다 던져서
XML로 된 날씨 정보를 읽어서 Print 함. getWeatherMap.pl 을 실행할 때 > 기호로 저장할 파일명을
지정해야 함. 안그러면 그냥 화면상에 출력되고는 사라짐.
(newWeather.bat의 둘째 줄을 보면 getWeatherMap.pl cities.txt > initWeathers.xml 라고 되어 있다.
getWeatherMap.pl을 실행시키되 cities.txt를 읽어서 initWeathers.xml로 출력하라는 뜻임)
4. 3에서 생성된 initWeathers.xml 파일을 읽어서 winXplanet 형식으로 변환해 weathermapMarker 파일을
생성함.
(newWeather.bat의 셋째 줄을 보면 weatherMap.pl initWeathers.xml > weathermapMarker 라고 되어 있다.
weatherMap.pl을 실행시키되 initWeathers.xml 를 읽어서 weathermapMarker로 출력하라는 뜻임)
5. weathermapMarker_RanomA 를 winXplanet 프로그램에 추가할 것.
(Parameter 탭 --> Xplanet Configuration 탭 --> Add Marker 로 추가. Apply changes로 반영.
Save config 해야 다음에도 가능함)
newWeather.bat
----------------------------------
@echo off
c:
cd C:\Program Files\winXPlanet\xplanet
getWeatherMap.pl cities.txt > markers\initWeathers.xml
weatherMap.pl markers\initWeathers.xml > markers\weathermapMarker_RanomA
cities.txt
---------------------------------------------------------------------------------
AEXX0001:U.A.E
ASXX0002:Alice Springs
ASXX0032:다윈
ASXX0089:Perth
ASXX0092:Port Hedland
ASXX0112:시드니
BGXX0003:다카
BMXX0005:양곤
BRXX0201:리오데자네이로
CAXX0518:밴쿠버
CDXX0003:은자메나
CGXX0005:킨샤샤
CHXX0008:북경
CHXX0017:충칭
CHXX0049:홍콩
CHXX0116:상해
CHXX0141:시안
EGXX0004:카이로
FRXX0076:파리
IDXX0005:발리
INXX0012:뱅갈로어
INXX0096:뉴델리
IRXX0018:테헤란
ITXX0067:로마
IVXX0001:아비쟌
JAXX0067:오끼나와
JAXX0078:삿뽀로
JAXX0085:도꾜
KEXX0009:케냐
KSXX0037:서울
LYXX0004:가트
MGXX0003:울란바토르
MXDF0132:멕시코씨티
MYXX0008:쿠알라룸푸르
#NPXX0002:카트만두
PEXX0011:Lima
PKXX0006:Islamabad
RPXX0017:마닐라
RSXX0063:모스크바
RSXX0122:야쿠츠크
RSXX0258:톰스크
SFXX0023:요하네스버그
SPXX0047:라스팔마스
SUXX0002:카르툼
THXX0002:방콕
TUXX0014:이스탄불
UKXX0085:런던
USAK0012:앵커리지
USCA0638:L.A.
USFL0316:마이애미
USGU0002:괌
USHI0026:호놀룰루
USNY0996:뉴욕
ZAXX0004:루사카
PPXX0004:Port Moresby
IDXX0002:Ambon
IDXX0089:Jayapura
BXXX0001:브루나이
#NZXX0049:웰링턴
#VMXX0006:하노이
#BMXX0001:만달레이
#IZXX0008:바그다드
#USMP0001:싸이판
#IDXX0022:자카르타
#IDXX0089:자야푸라
USPW0001:Palau
USWQ0002:Wake섬
USMH0003:Ebeye
TVXX0001:Tuvalu
#ASXX0016:브리즈번
ASXX0194:브리즈번
#ASXX0117:타운스빌
ASXX0020:Cairns
getWeatherMap.pl
----------------------------------
#!/usr/bin/perl
use LWP::Simple;
my $region_code;
my $region_name;
my $url;
while(<>)
{
$line = $_;
if($line =~ m/([^:]*):(.*)/)
{
$region_code = $1;
$region_name = $2;
}
$url = "http://xoap.weather.com/weather/local/" . $region_code . "?unit=m&dayf=1";
$html = get( $url );
$html =~ s/<dnam>([^<,]*).*<\/dnam>/<dnam>$region_name<\/dnam>/g;
print "$html";
}
weatherMap.pl
----------------------------------
#!/usr/bin/perl
use Encode; use strict; use warnings;
my $line;
my $lat;
my $lon;
my $dnam;
my $day_night;
my $day_icon;
my $day_hi;
my $day_low;
my $day_title;
my $night_icon;
my $night_hi;
my $night_low;
my $night_title;
my $icon;
my $hi;
my $low;
my $title;
my $color;
my $flag;
my $print_out1;
my $print_out2;
printf("-90 0 image=none\n");
while(<>)
{
$line = $_;
if($line =~ m/<dnam>([^<,]*).*<\/dnam>/)
{
$dnam = $1;
$flag = 1;
}
if($line =~ m/<lat>([^<]*)<\/lat>/)
{
$lat = $1;
}
if($line =~ m/<lon>([^<]*)<\/lon>/)
{
$lon = $1;
}
if($line =~ m/<hi>([^<]*)<\/hi>/)
{
$hi = $1;
if($hi =~ m/(-*\d{2})/)
{
$hi = $1;
}
elsif($hi =~ m/(-*)(\d)/)
{
$hi = $1 . "0" . $2;
}
if($hi eq "N/A")
{
$color = "Gray";
$hi = " ";
}
elsif($hi gt 30)
{
$color = "Red";
}
elsif($hi gt "20" && $hi le "30")
{
$color = "HotPink";
}
elsif($hi gt "10" && $hi le "20")
{
$color = "plum";
}
elsif($hi gt "0" && $hi le "10")
{
$color = "LightSteelBlue";
}
else
{
$color = "white";
}
}
if($line =~ m/<low>([^<]*)<\/low>/)
{
$low = $1;
if($low =~ m/(-*\d{2})/)
{
$low = $1;
}
elsif($low =~ m/(-*)(\d)/)
{
$low = $1 . "0" . $2;
}
if($low eq "N/A")
{
$low = " ";
}
if($hi eq " ")
{
if($low gt 30)
{
$color = "Red";
}
elsif($low gt "20" && $low le "30")
{
$color = "HotPink";
}
elsif($low gt "10" && $low le "20")
{
$color = "plum";
}
elsif($low gt 0 && $low le 10)
{
$color = "LightSteelBlue";
}
else
{
$color = "white";
}
}
}
if($line =~ m/<icon>([^<]*)<\/icon>/)
{
$icon = $1;
}
if($line =~ m/<t>([^<]*)<\/t>/)
{
if($flag > 0)
{
$title = $1;
if($title eq "N/A")
{
$title = " ";
$flag++;
}
else
{
$title =~ s/(Mon|Thu|Wed|Thr|Fri|Sat|Sun) +(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) +(\d{1,2}) +(\d{4}) +(\d{2}:\d{2}) +(AM|PM) +([A-Z]+)/$4-$2-$3/ig;
$title =~ s/-Jan-/-01-/ig;
$title =~ s/-Feb-/-02-/ig;
$title =~ s/-Mar-/-03-/ig;
$title =~ s/-Apr-/-04-/ig;
$title =~ s/-May-/-05-/ig;
$title =~ s/-Jun-/-06-/ig;
$title =~ s/-Jul-/-07-/ig;
$title =~ s/-Aug-/-08-/ig;
$title =~ s/-Sep-/-09-/ig;
$title =~ s/-Oct-/-10-/ig;
$title =~ s/-Nov-/-11-/ig;
$title =~ s/-Dec-/-12-/ig;
$title =~ s/AM/오전/ig;
$title =~ s/PM/오후/ig;
$title =~ s/(.*) Until (.*)/$2까지 $1/ig;
$title =~ s/(.*) For (\w+)/$1 For $dnam/ig;
$title =~ s/(.*) For (.*)/$2에 $1/ig;
$title =~ s/Few (.*)/$1 약간/ig;
$title =~ s/(.*) Late/늦게 $1/ig;
$title =~ s/(.*) Early/일찍 $1/ig;
$title =~ s/Widespread Dust/황사 현상/ig;
$title =~ s/Waxing Gibbous/오른쪽이 뚱뚱한 달/ig;
$title =~ s/Waxing Crescent/오른쪽이 홀죽한 초승달/ig;
$title =~ s/Waning Gibbous/왼쪽부분이 뚱뚱한 달/ig;
$title =~ s/Waning Crescent/왼쪽이 홀죽한 초승달/ig;
$title =~ s/Flash Flood/기습호우/ig;
$title =~ s/Winter Weather/한파/ig;
$title =~ s/Snow Showers*/눈보라/ig;
$title =~ s/Rain and Snow/진눈깨비/ig;
$title =~ s/Partly Cloudy/약간 흐림/ig;
$title =~ s/Moon Visibility/달 가시도/ig;
$title =~ s/Last quarter/하현달/ig;
$title =~ s/Isolated/국지성/ig;
$title =~ s/New Moon/초승달/ig;
$title =~ s/Full Moon/보름달/ig;
$title =~ s/Freezing Rain/착빙성 비/ig;
$title =~ s/First Quarter/상현달/ig;
$title =~ s/Few Showers*/매우 적은 비/ig;
$title =~ s/Windy/폭풍/ig;
$title =~ s/Wind/바람/ig;
$title =~ s/T-Storms/뇌우/ig;
$title =~ s/Sunny/화창/ig;
$title =~ s/Sun/해/ig;
$title =~ s/Snow/눈/ig;
$title =~ s/Showers*/소나기/ig;
$title =~ s/Scattered/산발성/ig;
$title =~ s/Rain/비/ig;
$title =~ s/Partly/약간/ig;
$title =~ s/Overcast/흐림/ig;
$title =~ s/Mostly/대체로/ig;
$title =~ s/Mist/옅은 안개/ig;
$title =~ s/Light/적은 비/ig;
$title =~ s/Humidity/습도/ig;
$title =~ s/Hot/더움/ig;
$title =~ s/Heavy/강한/ig;
$title =~ s/Dense/짙은/ig;
$title =~ s/Haze/연무/ig;
$title =~ s/Fog/안개/ig;
$title =~ s/Fair/맑음/ig;
$title =~ s/Drizzle/이슬비/ig;
$title =~ s/Cloudy/흐림/ig;
$title =~ s/Clouds/구름/ig;
$title =~ s/Clear/쾌청/ig;
$title =~ s/Flood/홍수/ig;
$title =~ s/Coastal/홍수/ig;
$title =~ s/Flash/기습/ig;
$title =~ s/Warning/경보/ig;
$title =~ s/Advisory/주의보/ig;
$title =~ s/Watch/주의보/ig;
$flag = 0;
$print_out1 = sprintf("%s %s \"%s\" align=Above color=LightBlue image=WeatherMapImages\\%s.png\n", $lat, $lon, $dnam, $icon);
if($hi eq " ")
{
$print_out2 = sprintf("%s %s \"%s/%s\" align=Below color=%s image=WeatherMapImages\\%s.png\n", $lat, $lon, $title, $low, $color, $icon);
}
elsif($low eq " ")
{
$print_out2 = sprintf("%s %s \"%s/%s\" align=Below color=%s image=WeatherMapImages\\%s.png\n", $lat, $lon, $title, $hi, $color, $icon);
}
else
{
$print_out2 = sprintf("%s %s \"%s/%s ~ %s\" align=Below color=%s image=WeatherMapImages\\%s.png\n", $lat, $lon, $title, $low, $hi, $color, $icon);
}
Encode::from_to ($print_out1, "euc-kr", "utf-8");
Encode::from_to ($print_out2, "euc-kr", "utf-8");
print($print_out1);
print($print_out2);
}
}
}
}
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 | 추천 수 |
|---|---|---|---|---|---|
| 835 | 예송논쟁 | RanomA | 2003.01.14 | 3938 | 0 |
| 834 | 갑자사화와 연산군식의 개혁 | RanomA | 2003.01.14 | 2297 | 0 |
| 833 | 이인화와 영원한 제국 | RanomA | 2003.01.14 | 1636 | 0 |
| 832 |
이상한 신문...
| RanomA | 2003.01.14 | 1023 | 10 |
| 831 | 필요한 건 상상력과 꼼꼼함... 그리고 긴 호흡... | RanomA | 2003.02.02 | 1249 | 0 |
| 830 | 일단 1권 다 읽었음... | RanomA | 2003.02.03 | 1398 | 0 |
| 829 | 추가로 영화와 책의 차이점. | RanomA | 2003.02.04 | 1327 | 0 |
| 828 | 성종이 어우동에게 느꼈던 분노감 | RanomA | 2003.02.11 | 2450 | 0 |
| 827 | 비둘기 가족을 부른 이석이라는 사람... | RanomA | 2003.02.16 | 1571 | 0 |
| 826 | 대한민국의 맘에 안드는 점 하나... | RanomA | 2003.02.19 | 1284 | 0 |
| 825 | 저는 오늘 꽃을 받았어요. [3] | RanomA | 2003.02.23 | 1516 | 0 |
| 824 | 난방보다 냉방이 어려운 이유... | RanomA | 2003.02.24 | 1911 | 0 |
| 823 | 그들이 하고픈 말은... [1] | RanomA | 2003.03.04 | 1210 | 0 |
| 822 | 제로보드와 내 홈피 게시판의 차이... | RanomA | 2003.03.09 | 2271 | 0 |
| 821 |
자료실의 첨부파일 개수가 무한대로...
| RanomA | 2003.03.26 | 1157 | 0 |
| 820 | MySQL 백업관련 명령어 몇 개 | RanomA | 2003.03.28 | 1123 | 0 |
| 819 |
MySQL 매뉴얼
| RanomA | 2003.03.28 | 936 | 14 |
| 818 |
Informix FAQ for Monitor, Tune, Support
| RanomA | 2003.04.08 | 926 | 11 |
| 817 | '근로자의 날'보다는 '노동절'이라고 칭합시다. | RanomA | 2003.04.29 | 981 | 0 |
| 816 | 나이수~~~ 유시민~~~ [2] | RanomA | 2003.04.29 | 1047 | 0 |






