|
|
|
17년 전
|
조회 1,681
|
|
|
|
17년 전
|
조회 1,818
|
|
|
|
17년 전
|
조회 2,955
|
|
|
|
17년 전
|
조회 2,095
|
|
|
|
17년 전
|
조회 1,770
|
|
|
|
17년 전
|
조회 2,106
|
|
|
|
17년 전
|
조회 1,819
|
|
|
|
17년 전
|
조회 3,354
|
|
|
|
17년 전
|
조회 1,533
|
|
|
|
17년 전
|
조회 1,659
|
|
|
|
17년 전
|
조회 1,374
|
|
|
|
17년 전
|
조회 2,188
|
|
|
|
17년 전
|
조회 3,132
|
|
|
|
17년 전
|
조회 2,275
|
|
|
|
17년 전
|
조회 1,731
|
|
|
|
17년 전
|
조회 2,985
|
|
|
|
17년 전
|
조회 4,431
|
|
|
|
17년 전
|
조회 1,747
|
|
|
|
17년 전
|
조회 3,240
|
|
|
|
17년 전
|
조회 1,571
|
|
|
|
17년 전
|
조회 3,484
|
|
|
|
17년 전
|
조회 5,841
|
|
|
|
17년 전
|
조회 1,425
|
|
|
|
17년 전
|
조회 2,158
|
|
|
|
17년 전
|
조회 1,789
|
|
|
|
17년 전
|
조회 1,531
|
|
|
|
17년 전
|
조회 2,418
|
|
|
|
17년 전
|
조회 2,630
|
|
|
|
17년 전
|
조회 1,594
|
|
|
|
17년 전
|
조회 2,683
|
|
|
|
17년 전
|
조회 3,172
|
|
|
|
17년 전
|
조회 1,527
|
|
|
|
17년 전
|
조회 1,942
|
|
|
|
17년 전
|
조회 3,846
|
|
|
|
17년 전
|
조회 4,477
|
|
|
|
17년 전
|
조회 1,870
|
|
|
|
17년 전
|
조회 1,732
|
|
|
|
17년 전
|
조회 2,670
|
|
|
|
17년 전
|
조회 1,850
|
|
|
|
17년 전
|
조회 3,937
|
|
|
|
17년 전
|
조회 1,644
|
|
|
|
16년 전
|
조회 1,928
|
|
|
|
17년 전
|
조회 2,261
|
|
|
|
17년 전
|
조회 2,109
|
|
|
|
18년 전
|
조회 3,567
|
|
|
|
18년 전
|
조회 1,586
|
|
|
|
18년 전
|
조회 2,657
|
|
|
|
18년 전
|
조회 1,638
|
|
|
|
18년 전
|
조회 1,907
|
|
|
|
18년 전
|
조회 7,427
|
|
|
|
18년 전
|
조회 1,998
|
|
|
|
18년 전
|
조회 4,089
|
|
|
|
18년 전
|
조회 2,422
|
|
|
|
18년 전
|
조회 2,433
|
|
|
|
18년 전
|
조회 2,151
|
|
|
|
18년 전
|
조회 2,196
|
|
|
|
18년 전
|
조회 2,618
|
|
|
관리자
|
18년 전
|
조회 3,216
|
|
|
관리자
|
18년 전
|
조회 5,325
|
|
|
|
18년 전
|
조회 2,780
|
|
|
|
18년 전
|
조회 2,698
|
|
|
|
18년 전
|
조회 2,546
|
|
|
|
18년 전
|
조회 1,797
|
|
|
|
18년 전
|
조회 2,203
|
|
|
관리자
|
18년 전
|
조회 5,311
|
|
|
|
18년 전
|
조회 3,022
|
|
|
|
18년 전
|
조회 2,587
|
|
|
|
18년 전
|
조회 3,258
|
|
|
|
18년 전
|
조회 2,480
|
|
|
|
18년 전
|
조회 2,835
|
|
|
|
18년 전
|
조회 5,865
|
|
|
|
18년 전
|
조회 2,617
|
|
|
|
18년 전
|
조회 2,011
|
|
|
|
18년 전
|
조회 2,645
|
|
|
|
18년 전
|
조회 1,475
|
|
|
|
18년 전
|
조회 9,797
|
|
|
|
18년 전
|
조회 4,456
|
|
|
관리자
|
18년 전
|
조회 3,283
|
|
|
관리자
|
18년 전
|
조회 1,810
|
|
|
|
18년 전
|
조회 3,601
|
|
|
|
18년 전
|
조회 2,280
|
|
|
|
18년 전
|
조회 3,728
|
|
|
|
18년 전
|
조회 5,178
|
|
|
|
18년 전
|
조회 3,830
|
|
|
|
18년 전
|
조회 2,673
|
|
|
관리자
|
18년 전
|
조회 2,938
|
|
|
|
18년 전
|
조회 2,446
|
|
|
|
18년 전
|
조회 2,785
|
|
|
|
18년 전
|
조회 1,899
|
|
|
관리자
|
18년 전
|
조회 3,437
|
|
|
|
18년 전
|
조회 2,139
|
|
|
|
18년 전
|
조회 2,266
|
|
|
|
18년 전
|
조회 2,083
|
|
|
|
18년 전
|
조회 3,050
|
|
|
|
18년 전
|
조회 1,999
|
|
|
|
18년 전
|
조회 2,666
|
|
|
|
18년 전
|
조회 3,869
|
|
|
|
18년 전
|
조회 4,564
|
|
|
|
18년 전
|
조회 2,373
|
|
|
|
18년 전
|
조회 2,844
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^