|
|
|
18년 전
|
조회 1,956
|
|
|
|
18년 전
|
조회 2,089
|
|
|
|
18년 전
|
조회 3,225
|
|
|
|
18년 전
|
조회 2,379
|
|
|
|
18년 전
|
조회 2,026
|
|
|
|
18년 전
|
조회 2,370
|
|
|
|
18년 전
|
조회 2,102
|
|
|
|
18년 전
|
조회 3,631
|
|
|
|
18년 전
|
조회 1,802
|
|
|
|
18년 전
|
조회 1,909
|
|
|
|
18년 전
|
조회 1,613
|
|
|
|
18년 전
|
조회 2,478
|
|
|
|
18년 전
|
조회 3,399
|
|
|
|
18년 전
|
조회 2,532
|
|
|
|
18년 전
|
조회 1,986
|
|
|
|
18년 전
|
조회 3,247
|
|
|
|
18년 전
|
조회 4,719
|
|
|
|
18년 전
|
조회 2,010
|
|
|
|
18년 전
|
조회 3,540
|
|
|
|
18년 전
|
조회 1,834
|
|
|
|
18년 전
|
조회 3,748
|
|
|
|
18년 전
|
조회 6,123
|
|
|
|
18년 전
|
조회 1,685
|
|
|
|
18년 전
|
조회 2,428
|
|
|
|
18년 전
|
조회 2,061
|
|
|
|
18년 전
|
조회 1,800
|
|
|
|
18년 전
|
조회 2,686
|
|
|
|
18년 전
|
조회 2,902
|
|
|
|
18년 전
|
조회 1,857
|
|
|
|
18년 전
|
조회 2,947
|
|
|
|
18년 전
|
조회 3,441
|
|
|
|
18년 전
|
조회 1,769
|
|
|
|
18년 전
|
조회 2,191
|
|
|
|
18년 전
|
조회 4,121
|
|
|
|
18년 전
|
조회 4,748
|
|
|
|
18년 전
|
조회 2,132
|
|
|
|
18년 전
|
조회 1,966
|
|
|
|
18년 전
|
조회 2,939
|
|
|
|
18년 전
|
조회 2,123
|
|
|
|
18년 전
|
조회 4,198
|
|
|
|
18년 전
|
조회 1,906
|
|
|
|
16년 전
|
조회 2,199
|
|
|
|
18년 전
|
조회 2,509
|
|
|
|
18년 전
|
조회 2,401
|
|
|
|
18년 전
|
조회 3,855
|
|
|
|
18년 전
|
조회 1,839
|
|
|
|
18년 전
|
조회 2,934
|
|
|
|
18년 전
|
조회 1,894
|
|
|
|
18년 전
|
조회 2,164
|
|
|
|
18년 전
|
조회 7,700
|
|
|
|
18년 전
|
조회 2,286
|
|
|
|
18년 전
|
조회 4,369
|
|
|
|
18년 전
|
조회 2,703
|
|
|
|
18년 전
|
조회 2,696
|
|
|
|
18년 전
|
조회 2,421
|
|
|
|
18년 전
|
조회 2,462
|
|
|
|
18년 전
|
조회 2,900
|
|
|
관리자
|
18년 전
|
조회 3,489
|
|
|
관리자
|
18년 전
|
조회 5,593
|
|
|
|
18년 전
|
조회 3,034
|
|
|
|
18년 전
|
조회 2,966
|
|
|
|
18년 전
|
조회 2,814
|
|
|
|
18년 전
|
조회 2,063
|
|
|
|
18년 전
|
조회 2,484
|
|
|
관리자
|
18년 전
|
조회 5,581
|
|
|
|
18년 전
|
조회 3,309
|
|
|
|
18년 전
|
조회 2,867
|
|
|
|
18년 전
|
조회 3,528
|
|
|
|
18년 전
|
조회 2,741
|
|
|
|
18년 전
|
조회 3,109
|
|
|
|
18년 전
|
조회 6,119
|
|
|
|
18년 전
|
조회 2,891
|
|
|
|
18년 전
|
조회 2,254
|
|
|
|
18년 전
|
조회 2,903
|
|
|
|
18년 전
|
조회 1,731
|
|
|
|
18년 전
|
조회 1만
|
|
|
|
18년 전
|
조회 4,728
|
|
|
관리자
|
18년 전
|
조회 3,541
|
|
|
관리자
|
18년 전
|
조회 2,079
|
|
|
|
18년 전
|
조회 3,847
|
|
|
|
18년 전
|
조회 2,537
|
|
|
|
18년 전
|
조회 3,993
|
|
|
|
18년 전
|
조회 5,413
|
|
|
|
18년 전
|
조회 4,082
|
|
|
|
18년 전
|
조회 2,932
|
|
|
관리자
|
18년 전
|
조회 3,208
|
|
|
|
18년 전
|
조회 2,708
|
|
|
|
18년 전
|
조회 3,037
|
|
|
|
18년 전
|
조회 2,155
|
|
|
관리자
|
18년 전
|
조회 3,698
|
|
|
|
18년 전
|
조회 2,386
|
|
|
|
18년 전
|
조회 2,522
|
|
|
|
18년 전
|
조회 2,334
|
|
|
|
18년 전
|
조회 3,315
|
|
|
|
18년 전
|
조회 2,255
|
|
|
|
18년 전
|
조회 2,935
|
|
|
|
18년 전
|
조회 4,109
|
|
|
|
18년 전
|
조회 4,829
|
|
|
|
18년 전
|
조회 2,633
|
|
|
|
18년 전
|
조회 3,110
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^