|
|
|
17년 전
|
조회 1,673
|
|
|
|
17년 전
|
조회 1,814
|
|
|
|
17년 전
|
조회 2,951
|
|
|
|
17년 전
|
조회 2,089
|
|
|
|
17년 전
|
조회 1,765
|
|
|
|
17년 전
|
조회 2,101
|
|
|
|
17년 전
|
조회 1,812
|
|
|
|
17년 전
|
조회 3,348
|
|
|
|
17년 전
|
조회 1,526
|
|
|
|
17년 전
|
조회 1,652
|
|
|
|
17년 전
|
조회 1,366
|
|
|
|
17년 전
|
조회 2,182
|
|
|
|
17년 전
|
조회 3,129
|
|
|
|
17년 전
|
조회 2,270
|
|
|
|
17년 전
|
조회 1,727
|
|
|
|
17년 전
|
조회 2,979
|
|
|
|
17년 전
|
조회 4,425
|
|
|
|
17년 전
|
조회 1,741
|
|
|
|
17년 전
|
조회 3,240
|
|
|
|
17년 전
|
조회 1,567
|
|
|
|
17년 전
|
조회 3,479
|
|
|
|
17년 전
|
조회 5,837
|
|
|
|
17년 전
|
조회 1,417
|
|
|
|
17년 전
|
조회 2,153
|
|
|
|
17년 전
|
조회 1,784
|
|
|
|
17년 전
|
조회 1,525
|
|
|
|
17년 전
|
조회 2,414
|
|
|
|
17년 전
|
조회 2,623
|
|
|
|
17년 전
|
조회 1,588
|
|
|
|
17년 전
|
조회 2,680
|
|
|
|
17년 전
|
조회 3,167
|
|
|
|
17년 전
|
조회 1,522
|
|
|
|
17년 전
|
조회 1,936
|
|
|
|
17년 전
|
조회 3,842
|
|
|
|
17년 전
|
조회 4,471
|
|
|
|
17년 전
|
조회 1,866
|
|
|
|
17년 전
|
조회 1,726
|
|
|
|
17년 전
|
조회 2,667
|
|
|
|
17년 전
|
조회 1,847
|
|
|
|
17년 전
|
조회 3,932
|
|
|
|
17년 전
|
조회 1,639
|
|
|
|
16년 전
|
조회 1,922
|
|
|
|
17년 전
|
조회 2,256
|
|
|
|
17년 전
|
조회 2,105
|
|
|
|
17년 전
|
조회 3,562
|
|
|
|
17년 전
|
조회 1,581
|
|
|
|
17년 전
|
조회 2,651
|
|
|
|
17년 전
|
조회 1,633
|
|
|
|
17년 전
|
조회 1,902
|
|
|
|
17년 전
|
조회 7,421
|
|
|
|
17년 전
|
조회 1,995
|
|
|
|
18년 전
|
조회 4,086
|
|
|
|
18년 전
|
조회 2,419
|
|
|
|
18년 전
|
조회 2,429
|
|
|
|
18년 전
|
조회 2,147
|
|
|
|
18년 전
|
조회 2,190
|
|
|
|
18년 전
|
조회 2,615
|
|
|
관리자
|
18년 전
|
조회 3,210
|
|
|
관리자
|
18년 전
|
조회 5,319
|
|
|
|
18년 전
|
조회 2,776
|
|
|
|
18년 전
|
조회 2,692
|
|
|
|
18년 전
|
조회 2,542
|
|
|
|
18년 전
|
조회 1,791
|
|
|
|
18년 전
|
조회 2,198
|
|
|
관리자
|
18년 전
|
조회 5,305
|
|
|
|
18년 전
|
조회 3,020
|
|
|
|
18년 전
|
조회 2,582
|
|
|
|
18년 전
|
조회 3,255
|
|
|
|
18년 전
|
조회 2,471
|
|
|
|
18년 전
|
조회 2,830
|
|
|
|
18년 전
|
조회 5,860
|
|
|
|
18년 전
|
조회 2,611
|
|
|
|
18년 전
|
조회 2,009
|
|
|
|
18년 전
|
조회 2,641
|
|
|
|
18년 전
|
조회 1,471
|
|
|
|
18년 전
|
조회 9,795
|
|
|
|
18년 전
|
조회 4,451
|
|
|
관리자
|
18년 전
|
조회 3,279
|
|
|
관리자
|
18년 전
|
조회 1,806
|
|
|
|
18년 전
|
조회 3,598
|
|
|
|
18년 전
|
조회 2,277
|
|
|
|
18년 전
|
조회 3,722
|
|
|
|
18년 전
|
조회 5,173
|
|
|
|
18년 전
|
조회 3,827
|
|
|
|
18년 전
|
조회 2,672
|
|
|
관리자
|
18년 전
|
조회 2,933
|
|
|
|
18년 전
|
조회 2,441
|
|
|
|
18년 전
|
조회 2,780
|
|
|
|
18년 전
|
조회 1,893
|
|
|
관리자
|
18년 전
|
조회 3,432
|
|
|
|
18년 전
|
조회 2,134
|
|
|
|
18년 전
|
조회 2,260
|
|
|
|
18년 전
|
조회 2,078
|
|
|
|
18년 전
|
조회 3,045
|
|
|
|
18년 전
|
조회 1,995
|
|
|
|
18년 전
|
조회 2,662
|
|
|
|
18년 전
|
조회 3,866
|
|
|
|
18년 전
|
조회 4,560
|
|
|
|
18년 전
|
조회 2,369
|
|
|
|
18년 전
|
조회 2,837
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^