|
|
|
17년 전
|
조회 1,728
|
|
|
|
17년 전
|
조회 1,866
|
|
|
|
17년 전
|
조회 2,997
|
|
|
|
17년 전
|
조회 2,140
|
|
|
|
17년 전
|
조회 1,813
|
|
|
|
17년 전
|
조회 2,150
|
|
|
|
17년 전
|
조회 1,868
|
|
|
|
17년 전
|
조회 3,406
|
|
|
|
17년 전
|
조회 1,576
|
|
|
|
17년 전
|
조회 1,701
|
|
|
|
17년 전
|
조회 1,416
|
|
|
|
17년 전
|
조회 2,235
|
|
|
|
17년 전
|
조회 3,175
|
|
|
|
17년 전
|
조회 2,322
|
|
|
|
17년 전
|
조회 1,777
|
|
|
|
17년 전
|
조회 3,039
|
|
|
|
17년 전
|
조회 4,489
|
|
|
|
17년 전
|
조회 1,791
|
|
|
|
17년 전
|
조회 3,293
|
|
|
|
17년 전
|
조회 1,616
|
|
|
|
17년 전
|
조회 3,533
|
|
|
|
17년 전
|
조회 5,882
|
|
|
|
17년 전
|
조회 1,463
|
|
|
|
17년 전
|
조회 2,200
|
|
|
|
17년 전
|
조회 1,826
|
|
|
|
17년 전
|
조회 1,578
|
|
|
|
17년 전
|
조회 2,465
|
|
|
|
17년 전
|
조회 2,674
|
|
|
|
18년 전
|
조회 1,636
|
|
|
|
18년 전
|
조회 2,728
|
|
|
|
18년 전
|
조회 3,210
|
|
|
|
18년 전
|
조회 1,562
|
|
|
|
18년 전
|
조회 1,989
|
|
|
|
18년 전
|
조회 3,891
|
|
|
|
18년 전
|
조회 4,520
|
|
|
|
18년 전
|
조회 1,921
|
|
|
|
18년 전
|
조회 1,773
|
|
|
|
18년 전
|
조회 2,720
|
|
|
|
18년 전
|
조회 1,894
|
|
|
|
18년 전
|
조회 3,971
|
|
|
|
18년 전
|
조회 1,684
|
|
|
|
16년 전
|
조회 1,976
|
|
|
|
18년 전
|
조회 2,299
|
|
|
|
18년 전
|
조회 2,157
|
|
|
|
18년 전
|
조회 3,613
|
|
|
|
18년 전
|
조회 1,622
|
|
|
|
18년 전
|
조회 2,698
|
|
|
|
18년 전
|
조회 1,684
|
|
|
|
18년 전
|
조회 1,953
|
|
|
|
18년 전
|
조회 7,470
|
|
|
|
18년 전
|
조회 2,035
|
|
|
|
18년 전
|
조회 4,134
|
|
|
|
18년 전
|
조회 2,460
|
|
|
|
18년 전
|
조회 2,472
|
|
|
|
18년 전
|
조회 2,195
|
|
|
|
18년 전
|
조회 2,235
|
|
|
|
18년 전
|
조회 2,667
|
|
|
관리자
|
18년 전
|
조회 3,252
|
|
|
관리자
|
18년 전
|
조회 5,365
|
|
|
|
18년 전
|
조회 2,818
|
|
|
|
18년 전
|
조회 2,739
|
|
|
|
18년 전
|
조회 2,588
|
|
|
|
18년 전
|
조회 1,837
|
|
|
|
18년 전
|
조회 2,240
|
|
|
관리자
|
18년 전
|
조회 5,350
|
|
|
|
18년 전
|
조회 3,067
|
|
|
|
18년 전
|
조회 2,626
|
|
|
|
18년 전
|
조회 3,305
|
|
|
|
18년 전
|
조회 2,521
|
|
|
|
18년 전
|
조회 2,877
|
|
|
|
18년 전
|
조회 5,906
|
|
|
|
18년 전
|
조회 2,653
|
|
|
|
18년 전
|
조회 2,050
|
|
|
|
18년 전
|
조회 2,687
|
|
|
|
18년 전
|
조회 1,511
|
|
|
|
18년 전
|
조회 9,847
|
|
|
|
18년 전
|
조회 4,497
|
|
|
관리자
|
18년 전
|
조회 3,331
|
|
|
관리자
|
18년 전
|
조회 1,851
|
|
|
|
18년 전
|
조회 3,646
|
|
|
|
18년 전
|
조회 2,316
|
|
|
|
18년 전
|
조회 3,772
|
|
|
|
18년 전
|
조회 5,212
|
|
|
|
18년 전
|
조회 3,876
|
|
|
|
18년 전
|
조회 2,709
|
|
|
관리자
|
18년 전
|
조회 2,982
|
|
|
|
18년 전
|
조회 2,490
|
|
|
|
18년 전
|
조회 2,825
|
|
|
|
18년 전
|
조회 1,934
|
|
|
관리자
|
18년 전
|
조회 3,481
|
|
|
|
18년 전
|
조회 2,171
|
|
|
|
18년 전
|
조회 2,300
|
|
|
|
18년 전
|
조회 2,123
|
|
|
|
18년 전
|
조회 3,096
|
|
|
|
18년 전
|
조회 2,037
|
|
|
|
18년 전
|
조회 2,701
|
|
|
|
18년 전
|
조회 3,905
|
|
|
|
18년 전
|
조회 4,605
|
|
|
|
18년 전
|
조회 2,419
|
|
|
|
18년 전
|
조회 2,891
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^