|
|
|
17년 전
|
조회 1,879
|
|
|
|
17년 전
|
조회 2,016
|
|
|
|
17년 전
|
조회 3,143
|
|
|
|
17년 전
|
조회 2,293
|
|
|
|
17년 전
|
조회 1,949
|
|
|
|
17년 전
|
조회 2,298
|
|
|
|
17년 전
|
조회 2,020
|
|
|
|
17년 전
|
조회 3,549
|
|
|
|
17년 전
|
조회 1,723
|
|
|
|
17년 전
|
조회 1,843
|
|
|
|
17년 전
|
조회 1,540
|
|
|
|
17년 전
|
조회 2,383
|
|
|
|
17년 전
|
조회 3,318
|
|
|
|
18년 전
|
조회 2,458
|
|
|
|
18년 전
|
조회 1,917
|
|
|
|
18년 전
|
조회 3,173
|
|
|
|
18년 전
|
조회 4,647
|
|
|
|
18년 전
|
조회 1,934
|
|
|
|
18년 전
|
조회 3,468
|
|
|
|
18년 전
|
조회 1,765
|
|
|
|
18년 전
|
조회 3,672
|
|
|
|
18년 전
|
조회 6,050
|
|
|
|
18년 전
|
조회 1,603
|
|
|
|
18년 전
|
조회 2,348
|
|
|
|
18년 전
|
조회 1,981
|
|
|
|
18년 전
|
조회 1,720
|
|
|
|
18년 전
|
조회 2,607
|
|
|
|
18년 전
|
조회 2,815
|
|
|
|
18년 전
|
조회 1,773
|
|
|
|
18년 전
|
조회 2,872
|
|
|
|
18년 전
|
조회 3,359
|
|
|
|
18년 전
|
조회 1,695
|
|
|
|
18년 전
|
조회 2,118
|
|
|
|
18년 전
|
조회 4,051
|
|
|
|
18년 전
|
조회 4,667
|
|
|
|
18년 전
|
조회 2,063
|
|
|
|
18년 전
|
조회 1,901
|
|
|
|
18년 전
|
조회 2,858
|
|
|
|
18년 전
|
조회 2,044
|
|
|
|
18년 전
|
조회 4,129
|
|
|
|
18년 전
|
조회 1,825
|
|
|
|
16년 전
|
조회 2,115
|
|
|
|
18년 전
|
조회 2,435
|
|
|
|
18년 전
|
조회 2,318
|
|
|
|
18년 전
|
조회 3,764
|
|
|
|
18년 전
|
조회 1,768
|
|
|
|
18년 전
|
조회 2,858
|
|
|
|
18년 전
|
조회 1,821
|
|
|
|
18년 전
|
조회 2,086
|
|
|
|
18년 전
|
조회 7,634
|
|
|
|
18년 전
|
조회 2,201
|
|
|
|
18년 전
|
조회 4,298
|
|
|
|
18년 전
|
조회 2,623
|
|
|
|
18년 전
|
조회 2,624
|
|
|
|
18년 전
|
조회 2,345
|
|
|
|
18년 전
|
조회 2,392
|
|
|
|
18년 전
|
조회 2,822
|
|
|
관리자
|
18년 전
|
조회 3,409
|
|
|
관리자
|
18년 전
|
조회 5,517
|
|
|
|
18년 전
|
조회 2,964
|
|
|
|
18년 전
|
조회 2,903
|
|
|
|
18년 전
|
조회 2,735
|
|
|
|
18년 전
|
조회 1,992
|
|
|
|
18년 전
|
조회 2,411
|
|
|
관리자
|
18년 전
|
조회 5,505
|
|
|
|
18년 전
|
조회 3,222
|
|
|
|
18년 전
|
조회 2,787
|
|
|
|
18년 전
|
조회 3,453
|
|
|
|
18년 전
|
조회 2,665
|
|
|
|
18년 전
|
조회 3,024
|
|
|
|
18년 전
|
조회 6,048
|
|
|
|
18년 전
|
조회 2,805
|
|
|
|
18년 전
|
조회 2,186
|
|
|
|
18년 전
|
조회 2,824
|
|
|
|
18년 전
|
조회 1,647
|
|
|
|
18년 전
|
조회 9,969
|
|
|
|
18년 전
|
조회 4,643
|
|
|
관리자
|
18년 전
|
조회 3,463
|
|
|
관리자
|
18년 전
|
조회 1,993
|
|
|
|
18년 전
|
조회 3,781
|
|
|
|
18년 전
|
조회 2,467
|
|
|
|
18년 전
|
조회 3,914
|
|
|
|
18년 전
|
조회 5,343
|
|
|
|
18년 전
|
조회 4,001
|
|
|
|
18년 전
|
조회 2,851
|
|
|
관리자
|
18년 전
|
조회 3,131
|
|
|
|
18년 전
|
조회 2,625
|
|
|
|
18년 전
|
조회 2,954
|
|
|
|
18년 전
|
조회 2,081
|
|
|
관리자
|
18년 전
|
조회 3,626
|
|
|
|
18년 전
|
조회 2,311
|
|
|
|
18년 전
|
조회 2,443
|
|
|
|
18년 전
|
조회 2,255
|
|
|
|
18년 전
|
조회 3,238
|
|
|
|
18년 전
|
조회 2,169
|
|
|
|
18년 전
|
조회 2,841
|
|
|
|
18년 전
|
조회 4,033
|
|
|
|
18년 전
|
조회 4,746
|
|
|
|
18년 전
|
조회 2,545
|
|
|
|
18년 전
|
조회 3,034
|
댓글 7개
근데 저거 금방없어질 예감인데 ㅋㅋ;;
날씨배너 색상별 지역별 75종 kweather 걸루 만들어 봤는데 구경오세요
kweather 은 회원가입도 해야하고 절차가 복잡하니 제 것 가져다 쓰세요
제것은 누르면 음악플레이어도 나옵니다.. 쩝..
http://blog.paran.com/necast/24428191
function make_weather(){
srand((double)microtime()*1000000);
$boundary = "---------------------".substr(md5(rand(0,32000)),0,10);
$header = "POST /XML/weather/sfc_web_map.xml HTTP/1.0\r\n";
$header .= "Host: kma.go.kr\r\n";
$header .= "Content-type: multipart/form-data, boundary=".$boundary."\r\n";
/*
// 본문 생성
foreach($sms AS $index => $value){
$data .="--$boundary\r\n";
$data .= "Content-Disposition: form-data; name=\"".$index."\"\r\n";
$data .= "\r\n".$value."\r\n";
$data .="--$boundary\r\n";
}
*/
$header .= "Content-length: " . strlen($data) . "\r\n\r\n";
$fp = fsockopen('kma.go.kr', 80);
if ($fp) {
fputs($fp, $header.$data);
$rsp = '';
while(!feof($fp)) {
$rsp .= fgets($fp,8192);
}
fclose($fp);
$msg = explode("\r\n\r\n",trim($rsp));
$rMsg = explode(",", $msg[1]);
}
$xmldoc = new DOMDocument();
$xmldoc->loadXML($msg[1]);
$local_dom_result = $xmldoc->getElementsByTagName('local');
$result = array();
foreach($local_dom_result as $subkey){
$ta = $subkey->getAttribute('ta');
$icon = $subkey->getAttribute('icon');
$name = iconv("UTF-8", "euckr",$subkey->nodeValue);
$result[$name]=array('icon'=>$icon, 'ta'=>$ta);
}
return $result;
}
// 결과 값은.
array(
array('속초'=>array('icon'=>'01', 'ta'=>'20.93'),
array('서울'=>array('icon'=>'02', 'ta'=>'24.93'),
);
형태 입니다.
디자이너가 어디서 날씨 스크롤 플래쉬소스를 떡하니 붙여 놔서 할수 없이 작업해야 했습니다.
icon을 넣는 이유는 아이콘도 기상청에서 제공하는 날씨 아이콘 숫자처럼 01.gif, 02.gif 로 있더군
요. 정확하게 매치되네요.
euc-kr 용이며, utf-8에서는 그냥 iconv 만 빼면 됩니다.
php.5.1 이상에서 작동하며, 이유는 simplexml 보다는 domdocument 가 나름 다루기 편해서입니다.
function make_weather(){
srand((double)microtime()*1000000);
$boundary = "---------------------".substr(md5(rand(0,32000)),0,10);
$header = "POST /XML/weather/sfc_web_map.xml HTTP/1.0\r\n";
$header .= "Host: kma.go.kr\r\n";
$header .= "Content-type: multipart/form-data, boundary=".$boundary."\r\n";
/*
// 본문 생성
foreach($sms AS $index => $value){
$data .="--$boundary\r\n";
$data .= "Content-Disposition: form-data; name=\"".$index."\"\r\n";
$data .= "\r\n".$value."\r\n";
$data .="--$boundary\r\n";
}
*/
$header .= "Content-length: " . strlen($data) . "\r\n\r\n";
$fp = fsockopen('kma.go.kr', 80);
if ($fp) {
fputs($fp, $header.$data);
$rsp = '';
while(!feof($fp)) {
$rsp .= fgets($fp,8192);
}
fclose($fp);
$msg = explode("\r\n\r\n",trim($rsp));
$rMsg = explode(",", $msg[1]);
}
$xmldoc = new DOMDocument();
$xmldoc->loadXML($msg[1]);
$local_dom_result = $xmldoc->getElementsByTagName('local');
$result = array();
foreach($local_dom_result as $subkey){
$ta = $subkey->getAttribute('ta');
$icon = $subkey->getAttribute('icon');
$name = iconv("UTF-8", "euckr",$subkey->nodeValue);
$result[$name]=array('icon'=>$icon, 'ta'=>$ta);
}
return $result;
}
// 결과 값은.
array(
array('속초'=>array('icon'=>'01', 'ta'=>'20.93'),
array('서울'=>array('icon'=>'02', 'ta'=>'24.93'),
);
형태 입니다.
디자이너가 어디서 날씨 스크롤 플래쉬소스를 떡하니 붙여 놔서 할수 없이 작업해야 했습니다.
icon을 넣는 이유는 아이콘도 기상청에서 제공하는 날씨 아이콘 숫자처럼 01.gif, 02.gif 로 있더군
요. 정확하게 매치되네요.
euc-kr 용이며, utf-8에서는 그냥 iconv 만 빼면 됩니다.
php.5.1 이상에서 작동하며, 이유는 simplexml 보다는 domdocument 가 나름 다루기 편해서입니다.
네발가락님 짱^^