|
|
|
17년 전
|
조회 1,714
|
|
|
|
17년 전
|
조회 1,856
|
|
|
|
17년 전
|
조회 2,984
|
|
|
|
17년 전
|
조회 2,133
|
|
|
|
17년 전
|
조회 1,800
|
|
|
|
17년 전
|
조회 2,143
|
|
|
|
17년 전
|
조회 1,853
|
|
|
|
17년 전
|
조회 3,396
|
|
|
|
17년 전
|
조회 1,567
|
|
|
|
17년 전
|
조회 1,689
|
|
|
|
17년 전
|
조회 1,408
|
|
|
|
17년 전
|
조회 2,221
|
|
|
|
17년 전
|
조회 3,162
|
|
|
|
17년 전
|
조회 2,308
|
|
|
|
17년 전
|
조회 1,763
|
|
|
|
17년 전
|
조회 3,024
|
|
|
|
17년 전
|
조회 4,469
|
|
|
|
17년 전
|
조회 1,779
|
|
|
|
17년 전
|
조회 3,273
|
|
|
|
17년 전
|
조회 1,599
|
|
|
|
17년 전
|
조회 3,515
|
|
|
|
17년 전
|
조회 5,871
|
|
|
|
17년 전
|
조회 1,448
|
|
|
|
17년 전
|
조회 2,192
|
|
|
|
17년 전
|
조회 1,812
|
|
|
|
17년 전
|
조회 1,570
|
|
|
|
17년 전
|
조회 2,452
|
|
|
|
17년 전
|
조회 2,660
|
|
|
|
17년 전
|
조회 1,625
|
|
|
|
18년 전
|
조회 2,714
|
|
|
|
18년 전
|
조회 3,200
|
|
|
|
18년 전
|
조회 1,554
|
|
|
|
18년 전
|
조회 1,976
|
|
|
|
18년 전
|
조회 3,878
|
|
|
|
18년 전
|
조회 4,508
|
|
|
|
18년 전
|
조회 1,900
|
|
|
|
18년 전
|
조회 1,764
|
|
|
|
18년 전
|
조회 2,702
|
|
|
|
18년 전
|
조회 1,879
|
|
|
|
18년 전
|
조회 3,960
|
|
|
|
18년 전
|
조회 1,674
|
|
|
|
16년 전
|
조회 1,961
|
|
|
|
18년 전
|
조회 2,288
|
|
|
|
18년 전
|
조회 2,140
|
|
|
|
18년 전
|
조회 3,599
|
|
|
|
18년 전
|
조회 1,614
|
|
|
|
18년 전
|
조회 2,680
|
|
|
|
18년 전
|
조회 1,672
|
|
|
|
18년 전
|
조회 1,940
|
|
|
|
18년 전
|
조회 7,456
|
|
|
|
18년 전
|
조회 2,027
|
|
|
|
18년 전
|
조회 4,116
|
|
|
|
18년 전
|
조회 2,450
|
|
|
|
18년 전
|
조회 2,460
|
|
|
|
18년 전
|
조회 2,181
|
|
|
|
18년 전
|
조회 2,221
|
|
|
|
18년 전
|
조회 2,648
|
|
|
관리자
|
18년 전
|
조회 3,240
|
|
|
관리자
|
18년 전
|
조회 5,355
|
|
|
|
18년 전
|
조회 2,814
|
|
|
|
18년 전
|
조회 2,727
|
|
|
|
18년 전
|
조회 2,575
|
|
|
|
18년 전
|
조회 1,825
|
|
|
|
18년 전
|
조회 2,235
|
|
|
관리자
|
18년 전
|
조회 5,341
|
|
|
|
18년 전
|
조회 3,057
|
|
|
|
18년 전
|
조회 2,615
|
|
|
|
18년 전
|
조회 3,287
|
|
|
|
18년 전
|
조회 2,509
|
|
|
|
18년 전
|
조회 2,863
|
|
|
|
18년 전
|
조회 5,898
|
|
|
|
18년 전
|
조회 2,642
|
|
|
|
18년 전
|
조회 2,040
|
|
|
|
18년 전
|
조회 2,678
|
|
|
|
18년 전
|
조회 1,503
|
|
|
|
18년 전
|
조회 9,833
|
|
|
|
18년 전
|
조회 4,481
|
|
|
관리자
|
18년 전
|
조회 3,320
|
|
|
관리자
|
18년 전
|
조회 1,841
|
|
|
|
18년 전
|
조회 3,634
|
|
|
|
18년 전
|
조회 2,310
|
|
|
|
18년 전
|
조회 3,759
|
|
|
|
18년 전
|
조회 5,203
|
|
|
|
18년 전
|
조회 3,860
|
|
|
|
18년 전
|
조회 2,694
|
|
|
관리자
|
18년 전
|
조회 2,968
|
|
|
|
18년 전
|
조회 2,475
|
|
|
|
18년 전
|
조회 2,809
|
|
|
|
18년 전
|
조회 1,927
|
|
|
관리자
|
18년 전
|
조회 3,467
|
|
|
|
18년 전
|
조회 2,160
|
|
|
|
18년 전
|
조회 2,291
|
|
|
|
18년 전
|
조회 2,111
|
|
|
|
18년 전
|
조회 3,083
|
|
|
|
18년 전
|
조회 2,028
|
|
|
|
18년 전
|
조회 2,689
|
|
|
|
18년 전
|
조회 3,897
|
|
|
|
18년 전
|
조회 4,594
|
|
|
|
18년 전
|
조회 2,404
|
|
|
|
18년 전
|
조회 2,878
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^