|
|
|
17년 전
|
조회 1,902
|
|
|
|
17년 전
|
조회 2,035
|
|
|
|
17년 전
|
조회 3,162
|
|
|
|
17년 전
|
조회 2,313
|
|
|
|
17년 전
|
조회 1,970
|
|
|
|
17년 전
|
조회 2,315
|
|
|
|
17년 전
|
조회 2,041
|
|
|
|
17년 전
|
조회 3,567
|
|
|
|
17년 전
|
조회 1,741
|
|
|
|
18년 전
|
조회 1,862
|
|
|
|
18년 전
|
조회 1,555
|
|
|
|
18년 전
|
조회 2,406
|
|
|
|
18년 전
|
조회 3,343
|
|
|
|
18년 전
|
조회 2,475
|
|
|
|
18년 전
|
조회 1,924
|
|
|
|
18년 전
|
조회 3,186
|
|
|
|
18년 전
|
조회 4,667
|
|
|
|
18년 전
|
조회 1,957
|
|
|
|
18년 전
|
조회 3,492
|
|
|
|
18년 전
|
조회 1,787
|
|
|
|
18년 전
|
조회 3,695
|
|
|
|
18년 전
|
조회 6,067
|
|
|
|
18년 전
|
조회 1,623
|
|
|
|
18년 전
|
조회 2,369
|
|
|
|
18년 전
|
조회 1,997
|
|
|
|
18년 전
|
조회 1,734
|
|
|
|
18년 전
|
조회 2,629
|
|
|
|
18년 전
|
조회 2,836
|
|
|
|
18년 전
|
조회 1,786
|
|
|
|
18년 전
|
조회 2,894
|
|
|
|
18년 전
|
조회 3,382
|
|
|
|
18년 전
|
조회 1,706
|
|
|
|
18년 전
|
조회 2,131
|
|
|
|
18년 전
|
조회 4,073
|
|
|
|
18년 전
|
조회 4,692
|
|
|
|
18년 전
|
조회 2,077
|
|
|
|
18년 전
|
조회 1,914
|
|
|
|
18년 전
|
조회 2,877
|
|
|
|
18년 전
|
조회 2,068
|
|
|
|
18년 전
|
조회 4,148
|
|
|
|
18년 전
|
조회 1,841
|
|
|
|
16년 전
|
조회 2,140
|
|
|
|
18년 전
|
조회 2,456
|
|
|
|
18년 전
|
조회 2,336
|
|
|
|
18년 전
|
조회 3,782
|
|
|
|
18년 전
|
조회 1,786
|
|
|
|
18년 전
|
조회 2,880
|
|
|
|
18년 전
|
조회 1,835
|
|
|
|
18년 전
|
조회 2,108
|
|
|
|
18년 전
|
조회 7,651
|
|
|
|
18년 전
|
조회 2,226
|
|
|
|
18년 전
|
조회 4,322
|
|
|
|
18년 전
|
조회 2,641
|
|
|
|
18년 전
|
조회 2,645
|
|
|
|
18년 전
|
조회 2,356
|
|
|
|
18년 전
|
조회 2,419
|
|
|
|
18년 전
|
조회 2,847
|
|
|
관리자
|
18년 전
|
조회 3,429
|
|
|
관리자
|
18년 전
|
조회 5,538
|
|
|
|
18년 전
|
조회 2,977
|
|
|
|
18년 전
|
조회 2,927
|
|
|
|
18년 전
|
조회 2,754
|
|
|
|
18년 전
|
조회 2,011
|
|
|
|
18년 전
|
조회 2,429
|
|
|
관리자
|
18년 전
|
조회 5,526
|
|
|
|
18년 전
|
조회 3,246
|
|
|
|
18년 전
|
조회 2,808
|
|
|
|
18년 전
|
조회 3,476
|
|
|
|
18년 전
|
조회 2,681
|
|
|
|
18년 전
|
조회 3,047
|
|
|
|
18년 전
|
조회 6,070
|
|
|
|
18년 전
|
조회 2,825
|
|
|
|
18년 전
|
조회 2,205
|
|
|
|
18년 전
|
조회 2,843
|
|
|
|
18년 전
|
조회 1,674
|
|
|
|
18년 전
|
조회 9,991
|
|
|
|
18년 전
|
조회 4,664
|
|
|
관리자
|
18년 전
|
조회 3,490
|
|
|
관리자
|
18년 전
|
조회 2,018
|
|
|
|
18년 전
|
조회 3,803
|
|
|
|
18년 전
|
조회 2,485
|
|
|
|
18년 전
|
조회 3,938
|
|
|
|
18년 전
|
조회 5,363
|
|
|
|
18년 전
|
조회 4,015
|
|
|
|
18년 전
|
조회 2,879
|
|
|
관리자
|
18년 전
|
조회 3,160
|
|
|
|
18년 전
|
조회 2,646
|
|
|
|
18년 전
|
조회 2,982
|
|
|
|
18년 전
|
조회 2,101
|
|
|
관리자
|
18년 전
|
조회 3,646
|
|
|
|
18년 전
|
조회 2,337
|
|
|
|
18년 전
|
조회 2,468
|
|
|
|
18년 전
|
조회 2,283
|
|
|
|
18년 전
|
조회 3,255
|
|
|
|
18년 전
|
조회 2,194
|
|
|
|
18년 전
|
조회 2,864
|
|
|
|
18년 전
|
조회 4,052
|
|
|
|
18년 전
|
조회 4,775
|
|
|
|
18년 전
|
조회 2,566
|
|
|
|
18년 전
|
조회 3,053
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^