|
|
|
17년 전
|
조회 1,671
|
|
|
|
17년 전
|
조회 1,811
|
|
|
|
17년 전
|
조회 2,948
|
|
|
|
17년 전
|
조회 2,084
|
|
|
|
17년 전
|
조회 1,761
|
|
|
|
17년 전
|
조회 2,097
|
|
|
|
17년 전
|
조회 1,808
|
|
|
|
17년 전
|
조회 3,345
|
|
|
|
17년 전
|
조회 1,523
|
|
|
|
17년 전
|
조회 1,649
|
|
|
|
17년 전
|
조회 1,364
|
|
|
|
17년 전
|
조회 2,179
|
|
|
|
17년 전
|
조회 3,126
|
|
|
|
17년 전
|
조회 2,267
|
|
|
|
17년 전
|
조회 1,724
|
|
|
|
17년 전
|
조회 2,976
|
|
|
|
17년 전
|
조회 4,422
|
|
|
|
17년 전
|
조회 1,738
|
|
|
|
17년 전
|
조회 3,236
|
|
|
|
17년 전
|
조회 1,563
|
|
|
|
17년 전
|
조회 3,475
|
|
|
|
17년 전
|
조회 5,834
|
|
|
|
17년 전
|
조회 1,416
|
|
|
|
17년 전
|
조회 2,147
|
|
|
|
17년 전
|
조회 1,782
|
|
|
|
17년 전
|
조회 1,522
|
|
|
|
17년 전
|
조회 2,412
|
|
|
|
17년 전
|
조회 2,620
|
|
|
|
17년 전
|
조회 1,586
|
|
|
|
17년 전
|
조회 2,677
|
|
|
|
17년 전
|
조회 3,165
|
|
|
|
17년 전
|
조회 1,519
|
|
|
|
17년 전
|
조회 1,933
|
|
|
|
17년 전
|
조회 3,838
|
|
|
|
17년 전
|
조회 4,468
|
|
|
|
17년 전
|
조회 1,865
|
|
|
|
17년 전
|
조회 1,722
|
|
|
|
17년 전
|
조회 2,663
|
|
|
|
17년 전
|
조회 1,844
|
|
|
|
17년 전
|
조회 3,928
|
|
|
|
17년 전
|
조회 1,636
|
|
|
|
16년 전
|
조회 1,919
|
|
|
|
17년 전
|
조회 2,254
|
|
|
|
17년 전
|
조회 2,102
|
|
|
|
17년 전
|
조회 3,559
|
|
|
|
17년 전
|
조회 1,578
|
|
|
|
17년 전
|
조회 2,647
|
|
|
|
17년 전
|
조회 1,628
|
|
|
|
17년 전
|
조회 1,899
|
|
|
|
17년 전
|
조회 7,418
|
|
|
|
17년 전
|
조회 1,992
|
|
|
|
17년 전
|
조회 4,082
|
|
|
|
18년 전
|
조회 2,417
|
|
|
|
18년 전
|
조회 2,426
|
|
|
|
18년 전
|
조회 2,144
|
|
|
|
18년 전
|
조회 2,186
|
|
|
|
18년 전
|
조회 2,612
|
|
|
관리자
|
18년 전
|
조회 3,207
|
|
|
관리자
|
18년 전
|
조회 5,316
|
|
|
|
18년 전
|
조회 2,773
|
|
|
|
18년 전
|
조회 2,688
|
|
|
|
18년 전
|
조회 2,538
|
|
|
|
18년 전
|
조회 1,787
|
|
|
|
18년 전
|
조회 2,194
|
|
|
관리자
|
18년 전
|
조회 5,301
|
|
|
|
18년 전
|
조회 3,016
|
|
|
|
18년 전
|
조회 2,579
|
|
|
|
18년 전
|
조회 3,251
|
|
|
|
18년 전
|
조회 2,469
|
|
|
|
18년 전
|
조회 2,827
|
|
|
|
18년 전
|
조회 5,858
|
|
|
|
18년 전
|
조회 2,608
|
|
|
|
18년 전
|
조회 2,005
|
|
|
|
18년 전
|
조회 2,638
|
|
|
|
18년 전
|
조회 1,468
|
|
|
|
18년 전
|
조회 9,792
|
|
|
|
18년 전
|
조회 4,447
|
|
|
관리자
|
18년 전
|
조회 3,276
|
|
|
관리자
|
18년 전
|
조회 1,805
|
|
|
|
18년 전
|
조회 3,594
|
|
|
|
18년 전
|
조회 2,274
|
|
|
|
18년 전
|
조회 3,721
|
|
|
|
18년 전
|
조회 5,169
|
|
|
|
18년 전
|
조회 3,823
|
|
|
|
18년 전
|
조회 2,669
|
|
|
관리자
|
18년 전
|
조회 2,928
|
|
|
|
18년 전
|
조회 2,438
|
|
|
|
18년 전
|
조회 2,776
|
|
|
|
18년 전
|
조회 1,890
|
|
|
관리자
|
18년 전
|
조회 3,429
|
|
|
|
18년 전
|
조회 2,130
|
|
|
|
18년 전
|
조회 2,258
|
|
|
|
18년 전
|
조회 2,074
|
|
|
|
18년 전
|
조회 3,042
|
|
|
|
18년 전
|
조회 1,991
|
|
|
|
18년 전
|
조회 2,659
|
|
|
|
18년 전
|
조회 3,862
|
|
|
|
18년 전
|
조회 4,556
|
|
|
|
18년 전
|
조회 2,365
|
|
|
|
18년 전
|
조회 2,834
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^