|
|
|
18년 전
|
조회 2,030
|
|
|
|
18년 전
|
조회 2,153
|
|
|
|
18년 전
|
조회 3,300
|
|
|
|
18년 전
|
조회 2,454
|
|
|
|
18년 전
|
조회 2,095
|
|
|
|
18년 전
|
조회 2,453
|
|
|
|
18년 전
|
조회 2,177
|
|
|
|
18년 전
|
조회 3,704
|
|
|
|
18년 전
|
조회 1,858
|
|
|
|
18년 전
|
조회 1,991
|
|
|
|
18년 전
|
조회 1,695
|
|
|
|
18년 전
|
조회 2,545
|
|
|
|
18년 전
|
조회 3,467
|
|
|
|
18년 전
|
조회 2,591
|
|
|
|
18년 전
|
조회 2,064
|
|
|
|
18년 전
|
조회 3,322
|
|
|
|
18년 전
|
조회 4,803
|
|
|
|
18년 전
|
조회 2,082
|
|
|
|
18년 전
|
조회 3,618
|
|
|
|
18년 전
|
조회 1,899
|
|
|
|
18년 전
|
조회 3,823
|
|
|
|
18년 전
|
조회 6,189
|
|
|
|
18년 전
|
조회 1,765
|
|
|
|
18년 전
|
조회 2,495
|
|
|
|
18년 전
|
조회 2,125
|
|
|
|
18년 전
|
조회 1,874
|
|
|
|
18년 전
|
조회 2,745
|
|
|
|
18년 전
|
조회 2,960
|
|
|
|
18년 전
|
조회 1,921
|
|
|
|
18년 전
|
조회 3,012
|
|
|
|
18년 전
|
조회 3,492
|
|
|
|
18년 전
|
조회 1,843
|
|
|
|
18년 전
|
조회 2,263
|
|
|
|
18년 전
|
조회 4,187
|
|
|
|
18년 전
|
조회 4,812
|
|
|
|
18년 전
|
조회 2,205
|
|
|
|
18년 전
|
조회 2,050
|
|
|
|
18년 전
|
조회 3,014
|
|
|
|
18년 전
|
조회 2,193
|
|
|
|
18년 전
|
조회 4,272
|
|
|
|
18년 전
|
조회 1,977
|
|
|
|
16년 전
|
조회 2,259
|
|
|
|
18년 전
|
조회 2,569
|
|
|
|
18년 전
|
조회 2,457
|
|
|
|
18년 전
|
조회 3,909
|
|
|
|
18년 전
|
조회 1,903
|
|
|
|
18년 전
|
조회 3,008
|
|
|
|
18년 전
|
조회 1,956
|
|
|
|
18년 전
|
조회 2,229
|
|
|
|
18년 전
|
조회 7,778
|
|
|
|
18년 전
|
조회 2,353
|
|
|
|
18년 전
|
조회 4,431
|
|
|
|
18년 전
|
조회 2,762
|
|
|
|
18년 전
|
조회 2,758
|
|
|
|
18년 전
|
조회 2,482
|
|
|
|
18년 전
|
조회 2,528
|
|
|
|
18년 전
|
조회 2,962
|
|
|
관리자
|
18년 전
|
조회 3,543
|
|
|
관리자
|
18년 전
|
조회 5,659
|
|
|
|
18년 전
|
조회 3,095
|
|
|
|
18년 전
|
조회 3,031
|
|
|
|
18년 전
|
조회 2,879
|
|
|
|
18년 전
|
조회 2,124
|
|
|
|
18년 전
|
조회 2,547
|
|
|
관리자
|
18년 전
|
조회 5,645
|
|
|
|
18년 전
|
조회 3,372
|
|
|
|
18년 전
|
조회 2,928
|
|
|
|
18년 전
|
조회 3,581
|
|
|
|
18년 전
|
조회 2,814
|
|
|
|
18년 전
|
조회 3,176
|
|
|
|
18년 전
|
조회 6,199
|
|
|
|
18년 전
|
조회 2,948
|
|
|
|
18년 전
|
조회 2,317
|
|
|
|
18년 전
|
조회 2,959
|
|
|
|
18년 전
|
조회 1,786
|
|
|
|
18년 전
|
조회 1만
|
|
|
|
18년 전
|
조회 4,782
|
|
|
관리자
|
18년 전
|
조회 3,609
|
|
|
관리자
|
18년 전
|
조회 2,149
|
|
|
|
18년 전
|
조회 3,913
|
|
|
|
18년 전
|
조회 2,603
|
|
|
|
18년 전
|
조회 4,055
|
|
|
|
18년 전
|
조회 5,474
|
|
|
|
18년 전
|
조회 4,144
|
|
|
|
18년 전
|
조회 2,997
|
|
|
관리자
|
18년 전
|
조회 3,271
|
|
|
|
18년 전
|
조회 2,767
|
|
|
|
18년 전
|
조회 3,096
|
|
|
|
18년 전
|
조회 2,212
|
|
|
관리자
|
18년 전
|
조회 3,766
|
|
|
|
18년 전
|
조회 2,447
|
|
|
|
18년 전
|
조회 2,583
|
|
|
|
18년 전
|
조회 2,391
|
|
|
|
18년 전
|
조회 3,377
|
|
|
|
18년 전
|
조회 2,309
|
|
|
|
18년 전
|
조회 2,989
|
|
|
|
18년 전
|
조회 4,174
|
|
|
|
18년 전
|
조회 4,892
|
|
|
|
18년 전
|
조회 2,698
|
|
|
|
18년 전
|
조회 3,164
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^