|
|
|
17년 전
|
조회 1,714
|
|
|
|
17년 전
|
조회 1,856
|
|
|
|
17년 전
|
조회 2,984
|
|
|
|
17년 전
|
조회 2,133
|
|
|
|
17년 전
|
조회 1,803
|
|
|
|
17년 전
|
조회 2,144
|
|
|
|
17년 전
|
조회 1,856
|
|
|
|
17년 전
|
조회 3,398
|
|
|
|
17년 전
|
조회 1,570
|
|
|
|
17년 전
|
조회 1,691
|
|
|
|
17년 전
|
조회 1,409
|
|
|
|
17년 전
|
조회 2,225
|
|
|
|
17년 전
|
조회 3,165
|
|
|
|
17년 전
|
조회 2,311
|
|
|
|
17년 전
|
조회 1,763
|
|
|
|
17년 전
|
조회 3,024
|
|
|
|
17년 전
|
조회 4,473
|
|
|
|
17년 전
|
조회 1,780
|
|
|
|
17년 전
|
조회 3,275
|
|
|
|
17년 전
|
조회 1,603
|
|
|
|
17년 전
|
조회 3,517
|
|
|
|
17년 전
|
조회 5,875
|
|
|
|
17년 전
|
조회 1,450
|
|
|
|
17년 전
|
조회 2,192
|
|
|
|
17년 전
|
조회 1,814
|
|
|
|
17년 전
|
조회 1,570
|
|
|
|
17년 전
|
조회 2,453
|
|
|
|
17년 전
|
조회 2,661
|
|
|
|
18년 전
|
조회 1,625
|
|
|
|
18년 전
|
조회 2,716
|
|
|
|
18년 전
|
조회 3,201
|
|
|
|
18년 전
|
조회 1,557
|
|
|
|
18년 전
|
조회 1,976
|
|
|
|
18년 전
|
조회 3,879
|
|
|
|
18년 전
|
조회 4,511
|
|
|
|
18년 전
|
조회 1,904
|
|
|
|
18년 전
|
조회 1,764
|
|
|
|
18년 전
|
조회 2,703
|
|
|
|
18년 전
|
조회 1,879
|
|
|
|
18년 전
|
조회 3,962
|
|
|
|
18년 전
|
조회 1,675
|
|
|
|
16년 전
|
조회 1,963
|
|
|
|
18년 전
|
조회 2,291
|
|
|
|
18년 전
|
조회 2,142
|
|
|
|
18년 전
|
조회 3,601
|
|
|
|
18년 전
|
조회 1,617
|
|
|
|
18년 전
|
조회 2,684
|
|
|
|
18년 전
|
조회 1,674
|
|
|
|
18년 전
|
조회 1,941
|
|
|
|
18년 전
|
조회 7,458
|
|
|
|
18년 전
|
조회 2,028
|
|
|
|
18년 전
|
조회 4,117
|
|
|
|
18년 전
|
조회 2,452
|
|
|
|
18년 전
|
조회 2,463
|
|
|
|
18년 전
|
조회 2,186
|
|
|
|
18년 전
|
조회 2,221
|
|
|
|
18년 전
|
조회 2,648
|
|
|
관리자
|
18년 전
|
조회 3,240
|
|
|
관리자
|
18년 전
|
조회 5,357
|
|
|
|
18년 전
|
조회 2,815
|
|
|
|
18년 전
|
조회 2,729
|
|
|
|
18년 전
|
조회 2,576
|
|
|
|
18년 전
|
조회 1,826
|
|
|
|
18년 전
|
조회 2,235
|
|
|
관리자
|
18년 전
|
조회 5,343
|
|
|
|
18년 전
|
조회 3,057
|
|
|
|
18년 전
|
조회 2,617
|
|
|
|
18년 전
|
조회 3,290
|
|
|
|
18년 전
|
조회 2,512
|
|
|
|
18년 전
|
조회 2,865
|
|
|
|
18년 전
|
조회 5,898
|
|
|
|
18년 전
|
조회 2,646
|
|
|
|
18년 전
|
조회 2,042
|
|
|
|
18년 전
|
조회 2,679
|
|
|
|
18년 전
|
조회 1,504
|
|
|
|
18년 전
|
조회 9,833
|
|
|
|
18년 전
|
조회 4,482
|
|
|
관리자
|
18년 전
|
조회 3,323
|
|
|
관리자
|
18년 전
|
조회 1,844
|
|
|
|
18년 전
|
조회 3,635
|
|
|
|
18년 전
|
조회 2,312
|
|
|
|
18년 전
|
조회 3,760
|
|
|
|
18년 전
|
조회 5,204
|
|
|
|
18년 전
|
조회 3,864
|
|
|
|
18년 전
|
조회 2,695
|
|
|
관리자
|
18년 전
|
조회 2,969
|
|
|
|
18년 전
|
조회 2,477
|
|
|
|
18년 전
|
조회 2,812
|
|
|
|
18년 전
|
조회 1,927
|
|
|
관리자
|
18년 전
|
조회 3,470
|
|
|
|
18년 전
|
조회 2,160
|
|
|
|
18년 전
|
조회 2,291
|
|
|
|
18년 전
|
조회 2,113
|
|
|
|
18년 전
|
조회 3,087
|
|
|
|
18년 전
|
조회 2,028
|
|
|
|
18년 전
|
조회 2,690
|
|
|
|
18년 전
|
조회 3,897
|
|
|
|
18년 전
|
조회 4,595
|
|
|
|
18년 전
|
조회 2,404
|
|
|
|
18년 전
|
조회 2,879
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^