|
|
|
17년 전
|
조회 1,923
|
|
|
|
18년 전
|
조회 2,057
|
|
|
|
18년 전
|
조회 3,187
|
|
|
|
18년 전
|
조회 2,335
|
|
|
|
18년 전
|
조회 1,991
|
|
|
|
18년 전
|
조회 2,342
|
|
|
|
18년 전
|
조회 2,070
|
|
|
|
18년 전
|
조회 3,595
|
|
|
|
18년 전
|
조회 1,763
|
|
|
|
18년 전
|
조회 1,879
|
|
|
|
18년 전
|
조회 1,579
|
|
|
|
18년 전
|
조회 2,433
|
|
|
|
18년 전
|
조회 3,361
|
|
|
|
18년 전
|
조회 2,508
|
|
|
|
18년 전
|
조회 1,946
|
|
|
|
18년 전
|
조회 3,214
|
|
|
|
18년 전
|
조회 4,692
|
|
|
|
18년 전
|
조회 1,977
|
|
|
|
18년 전
|
조회 3,509
|
|
|
|
18년 전
|
조회 1,802
|
|
|
|
18년 전
|
조회 3,717
|
|
|
|
18년 전
|
조회 6,093
|
|
|
|
18년 전
|
조회 1,642
|
|
|
|
18년 전
|
조회 2,399
|
|
|
|
18년 전
|
조회 2,023
|
|
|
|
18년 전
|
조회 1,756
|
|
|
|
18년 전
|
조회 2,650
|
|
|
|
18년 전
|
조회 2,865
|
|
|
|
18년 전
|
조회 1,815
|
|
|
|
18년 전
|
조회 2,916
|
|
|
|
18년 전
|
조회 3,408
|
|
|
|
18년 전
|
조회 1,733
|
|
|
|
18년 전
|
조회 2,154
|
|
|
|
18년 전
|
조회 4,091
|
|
|
|
18년 전
|
조회 4,718
|
|
|
|
18년 전
|
조회 2,100
|
|
|
|
18년 전
|
조회 1,930
|
|
|
|
18년 전
|
조회 2,904
|
|
|
|
18년 전
|
조회 2,093
|
|
|
|
18년 전
|
조회 4,174
|
|
|
|
18년 전
|
조회 1,866
|
|
|
|
16년 전
|
조회 2,160
|
|
|
|
18년 전
|
조회 2,481
|
|
|
|
18년 전
|
조회 2,365
|
|
|
|
18년 전
|
조회 3,818
|
|
|
|
18년 전
|
조회 1,805
|
|
|
|
18년 전
|
조회 2,907
|
|
|
|
18년 전
|
조회 1,862
|
|
|
|
18년 전
|
조회 2,127
|
|
|
|
18년 전
|
조회 7,671
|
|
|
|
18년 전
|
조회 2,252
|
|
|
|
18년 전
|
조회 4,348
|
|
|
|
18년 전
|
조회 2,667
|
|
|
|
18년 전
|
조회 2,673
|
|
|
|
18년 전
|
조회 2,387
|
|
|
|
18년 전
|
조회 2,441
|
|
|
|
18년 전
|
조회 2,870
|
|
|
관리자
|
18년 전
|
조회 3,461
|
|
|
관리자
|
18년 전
|
조회 5,560
|
|
|
|
18년 전
|
조회 3,005
|
|
|
|
18년 전
|
조회 2,949
|
|
|
|
18년 전
|
조회 2,780
|
|
|
|
18년 전
|
조회 2,041
|
|
|
|
18년 전
|
조회 2,453
|
|
|
관리자
|
18년 전
|
조회 5,556
|
|
|
|
18년 전
|
조회 3,273
|
|
|
|
18년 전
|
조회 2,835
|
|
|
|
18년 전
|
조회 3,504
|
|
|
|
18년 전
|
조회 2,706
|
|
|
|
18년 전
|
조회 3,074
|
|
|
|
18년 전
|
조회 6,096
|
|
|
|
18년 전
|
조회 2,852
|
|
|
|
18년 전
|
조회 2,231
|
|
|
|
18년 전
|
조회 2,873
|
|
|
|
18년 전
|
조회 1,700
|
|
|
|
18년 전
|
조회 1만
|
|
|
|
18년 전
|
조회 4,691
|
|
|
관리자
|
18년 전
|
조회 3,514
|
|
|
관리자
|
18년 전
|
조회 2,046
|
|
|
|
18년 전
|
조회 3,830
|
|
|
|
18년 전
|
조회 2,511
|
|
|
|
18년 전
|
조회 3,957
|
|
|
|
18년 전
|
조회 5,385
|
|
|
|
18년 전
|
조회 4,047
|
|
|
|
18년 전
|
조회 2,912
|
|
|
관리자
|
18년 전
|
조회 3,185
|
|
|
|
18년 전
|
조회 2,677
|
|
|
|
18년 전
|
조회 3,003
|
|
|
|
18년 전
|
조회 2,123
|
|
|
관리자
|
18년 전
|
조회 3,675
|
|
|
|
18년 전
|
조회 2,359
|
|
|
|
18년 전
|
조회 2,496
|
|
|
|
18년 전
|
조회 2,303
|
|
|
|
18년 전
|
조회 3,279
|
|
|
|
18년 전
|
조회 2,220
|
|
|
|
18년 전
|
조회 2,896
|
|
|
|
18년 전
|
조회 4,080
|
|
|
|
18년 전
|
조회 4,800
|
|
|
|
18년 전
|
조회 2,599
|
|
|
|
18년 전
|
조회 3,085
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^