|
|
|
17년 전
|
조회 1,840
|
|
|
|
17년 전
|
조회 1,982
|
|
|
|
17년 전
|
조회 3,106
|
|
|
|
17년 전
|
조회 2,257
|
|
|
|
17년 전
|
조회 1,913
|
|
|
|
17년 전
|
조회 2,260
|
|
|
|
17년 전
|
조회 1,980
|
|
|
|
17년 전
|
조회 3,516
|
|
|
|
17년 전
|
조회 1,688
|
|
|
|
17년 전
|
조회 1,807
|
|
|
|
17년 전
|
조회 1,505
|
|
|
|
17년 전
|
조회 2,345
|
|
|
|
17년 전
|
조회 3,281
|
|
|
|
17년 전
|
조회 2,430
|
|
|
|
17년 전
|
조회 1,879
|
|
|
|
18년 전
|
조회 3,133
|
|
|
|
18년 전
|
조회 4,611
|
|
|
|
18년 전
|
조회 1,897
|
|
|
|
18년 전
|
조회 3,423
|
|
|
|
18년 전
|
조회 1,727
|
|
|
|
18년 전
|
조회 3,637
|
|
|
|
18년 전
|
조회 6,010
|
|
|
|
18년 전
|
조회 1,562
|
|
|
|
18년 전
|
조회 2,314
|
|
|
|
18년 전
|
조회 1,944
|
|
|
|
18년 전
|
조회 1,683
|
|
|
|
18년 전
|
조회 2,578
|
|
|
|
18년 전
|
조회 2,774
|
|
|
|
18년 전
|
조회 1,740
|
|
|
|
18년 전
|
조회 2,837
|
|
|
|
18년 전
|
조회 3,331
|
|
|
|
18년 전
|
조회 1,654
|
|
|
|
18년 전
|
조회 2,082
|
|
|
|
18년 전
|
조회 4,007
|
|
|
|
18년 전
|
조회 4,630
|
|
|
|
18년 전
|
조회 2,027
|
|
|
|
18년 전
|
조회 1,864
|
|
|
|
18년 전
|
조회 2,819
|
|
|
|
18년 전
|
조회 2,008
|
|
|
|
18년 전
|
조회 4,095
|
|
|
|
18년 전
|
조회 1,780
|
|
|
|
16년 전
|
조회 2,074
|
|
|
|
18년 전
|
조회 2,397
|
|
|
|
18년 전
|
조회 2,280
|
|
|
|
18년 전
|
조회 3,733
|
|
|
|
18년 전
|
조회 1,733
|
|
|
|
18년 전
|
조회 2,807
|
|
|
|
18년 전
|
조회 1,787
|
|
|
|
18년 전
|
조회 2,042
|
|
|
|
18년 전
|
조회 7,598
|
|
|
|
18년 전
|
조회 2,163
|
|
|
|
18년 전
|
조회 4,255
|
|
|
|
18년 전
|
조회 2,583
|
|
|
|
18년 전
|
조회 2,591
|
|
|
|
18년 전
|
조회 2,298
|
|
|
|
18년 전
|
조회 2,357
|
|
|
|
18년 전
|
조회 2,783
|
|
|
관리자
|
18년 전
|
조회 3,375
|
|
|
관리자
|
18년 전
|
조회 5,480
|
|
|
|
18년 전
|
조회 2,936
|
|
|
|
18년 전
|
조회 2,860
|
|
|
|
18년 전
|
조회 2,702
|
|
|
|
18년 전
|
조회 1,953
|
|
|
|
18년 전
|
조회 2,370
|
|
|
관리자
|
18년 전
|
조회 5,474
|
|
|
|
18년 전
|
조회 3,190
|
|
|
|
18년 전
|
조회 2,751
|
|
|
|
18년 전
|
조회 3,416
|
|
|
|
18년 전
|
조회 2,627
|
|
|
|
18년 전
|
조회 2,986
|
|
|
|
18년 전
|
조회 6,007
|
|
|
|
18년 전
|
조회 2,769
|
|
|
|
18년 전
|
조회 2,148
|
|
|
|
18년 전
|
조회 2,793
|
|
|
|
18년 전
|
조회 1,618
|
|
|
|
18년 전
|
조회 9,931
|
|
|
|
18년 전
|
조회 4,603
|
|
|
관리자
|
18년 전
|
조회 3,431
|
|
|
관리자
|
18년 전
|
조회 1,963
|
|
|
|
18년 전
|
조회 3,744
|
|
|
|
18년 전
|
조회 2,432
|
|
|
|
18년 전
|
조회 3,865
|
|
|
|
18년 전
|
조회 5,307
|
|
|
|
18년 전
|
조회 3,967
|
|
|
|
18년 전
|
조회 2,813
|
|
|
관리자
|
18년 전
|
조회 3,097
|
|
|
|
18년 전
|
조회 2,590
|
|
|
|
18년 전
|
조회 2,921
|
|
|
|
18년 전
|
조회 2,042
|
|
|
관리자
|
18년 전
|
조회 3,587
|
|
|
|
18년 전
|
조회 2,272
|
|
|
|
18년 전
|
조회 2,412
|
|
|
|
18년 전
|
조회 2,222
|
|
|
|
18년 전
|
조회 3,199
|
|
|
|
18년 전
|
조회 2,134
|
|
|
|
18년 전
|
조회 2,813
|
|
|
|
18년 전
|
조회 3,996
|
|
|
|
18년 전
|
조회 4,707
|
|
|
|
18년 전
|
조회 2,514
|
|
|
|
18년 전
|
조회 2,993
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^