|
|
|
17년 전
|
조회 1,682
|
|
|
|
17년 전
|
조회 1,823
|
|
|
|
17년 전
|
조회 2,957
|
|
|
|
17년 전
|
조회 2,099
|
|
|
|
17년 전
|
조회 1,773
|
|
|
|
17년 전
|
조회 2,108
|
|
|
|
17년 전
|
조회 1,822
|
|
|
|
17년 전
|
조회 3,358
|
|
|
|
17년 전
|
조회 1,536
|
|
|
|
17년 전
|
조회 1,663
|
|
|
|
17년 전
|
조회 1,377
|
|
|
|
17년 전
|
조회 2,191
|
|
|
|
17년 전
|
조회 3,137
|
|
|
|
17년 전
|
조회 2,279
|
|
|
|
17년 전
|
조회 1,736
|
|
|
|
17년 전
|
조회 2,989
|
|
|
|
17년 전
|
조회 4,437
|
|
|
|
17년 전
|
조회 1,749
|
|
|
|
17년 전
|
조회 3,246
|
|
|
|
17년 전
|
조회 1,573
|
|
|
|
17년 전
|
조회 3,488
|
|
|
|
17년 전
|
조회 5,844
|
|
|
|
17년 전
|
조회 1,425
|
|
|
|
17년 전
|
조회 2,164
|
|
|
|
17년 전
|
조회 1,791
|
|
|
|
17년 전
|
조회 1,533
|
|
|
|
17년 전
|
조회 2,419
|
|
|
|
17년 전
|
조회 2,632
|
|
|
|
17년 전
|
조회 1,595
|
|
|
|
17년 전
|
조회 2,687
|
|
|
|
17년 전
|
조회 3,175
|
|
|
|
17년 전
|
조회 1,530
|
|
|
|
17년 전
|
조회 1,944
|
|
|
|
17년 전
|
조회 3,850
|
|
|
|
17년 전
|
조회 4,479
|
|
|
|
17년 전
|
조회 1,873
|
|
|
|
17년 전
|
조회 1,734
|
|
|
|
17년 전
|
조회 2,672
|
|
|
|
17년 전
|
조회 1,854
|
|
|
|
18년 전
|
조회 3,938
|
|
|
|
18년 전
|
조회 1,648
|
|
|
|
16년 전
|
조회 1,931
|
|
|
|
18년 전
|
조회 2,263
|
|
|
|
18년 전
|
조회 2,114
|
|
|
|
18년 전
|
조회 3,570
|
|
|
|
18년 전
|
조회 1,588
|
|
|
|
18년 전
|
조회 2,658
|
|
|
|
18년 전
|
조회 1,642
|
|
|
|
18년 전
|
조회 1,909
|
|
|
|
18년 전
|
조회 7,431
|
|
|
|
18년 전
|
조회 1,998
|
|
|
|
18년 전
|
조회 4,094
|
|
|
|
18년 전
|
조회 2,425
|
|
|
|
18년 전
|
조회 2,434
|
|
|
|
18년 전
|
조회 2,155
|
|
|
|
18년 전
|
조회 2,199
|
|
|
|
18년 전
|
조회 2,621
|
|
|
관리자
|
18년 전
|
조회 3,218
|
|
|
관리자
|
18년 전
|
조회 5,329
|
|
|
|
18년 전
|
조회 2,783
|
|
|
|
18년 전
|
조회 2,701
|
|
|
|
18년 전
|
조회 2,552
|
|
|
|
18년 전
|
조회 1,800
|
|
|
|
18년 전
|
조회 2,206
|
|
|
관리자
|
18년 전
|
조회 5,315
|
|
|
|
18년 전
|
조회 3,024
|
|
|
|
18년 전
|
조회 2,591
|
|
|
|
18년 전
|
조회 3,262
|
|
|
|
18년 전
|
조회 2,483
|
|
|
|
18년 전
|
조회 2,839
|
|
|
|
18년 전
|
조회 5,873
|
|
|
|
18년 전
|
조회 2,619
|
|
|
|
18년 전
|
조회 2,015
|
|
|
|
18년 전
|
조회 2,651
|
|
|
|
18년 전
|
조회 1,479
|
|
|
|
18년 전
|
조회 9,803
|
|
|
|
18년 전
|
조회 4,461
|
|
|
관리자
|
18년 전
|
조회 3,289
|
|
|
관리자
|
18년 전
|
조회 1,812
|
|
|
|
18년 전
|
조회 3,606
|
|
|
|
18년 전
|
조회 2,286
|
|
|
|
18년 전
|
조회 3,732
|
|
|
|
18년 전
|
조회 5,180
|
|
|
|
18년 전
|
조회 3,836
|
|
|
|
18년 전
|
조회 2,674
|
|
|
관리자
|
18년 전
|
조회 2,938
|
|
|
|
18년 전
|
조회 2,450
|
|
|
|
18년 전
|
조회 2,789
|
|
|
|
18년 전
|
조회 1,901
|
|
|
관리자
|
18년 전
|
조회 3,440
|
|
|
|
18년 전
|
조회 2,140
|
|
|
|
18년 전
|
조회 2,269
|
|
|
|
18년 전
|
조회 2,085
|
|
|
|
18년 전
|
조회 3,054
|
|
|
|
18년 전
|
조회 2,002
|
|
|
|
18년 전
|
조회 2,670
|
|
|
|
18년 전
|
조회 3,873
|
|
|
|
18년 전
|
조회 4,565
|
|
|
|
18년 전
|
조회 2,373
|
|
|
|
18년 전
|
조회 2,846
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^