|
|
|
08-04-17
|
조회 5,686
|
|
|
|
08-04-17
|
조회 3,828
|
|
|
|
08-04-17
|
조회 8,820
|
|
|
|
08-04-17
|
조회 5,295
|
|
|
|
08-04-17
|
조회 5,511
|
|
|
|
08-04-17
|
조회 3,749
|
|
|
|
08-04-17
|
조회 4,501
|
|
|
|
08-04-17
|
조회 5,044
|
|
|
|
08-04-17
|
조회 5,397
|
|
|
|
08-04-17
|
조회 4,618
|
|
|
|
08-04-17
|
조회 4,613
|
|
|
|
08-04-17
|
조회 4,745
|
|
|
|
08-04-17
|
조회 3,825
|
|
|
|
08-04-17
|
조회 3,397
|
|
|
|
08-04-17
|
조회 4,408
|
|
|
|
08-04-17
|
조회 4,663
|
|
|
|
08-04-17
|
조회 6,073
|
|
|
|
08-04-17
|
조회 2,875
|
|
|
|
08-04-17
|
조회 4,053
|
|
|
|
08-04-17
|
조회 4,064
|
|
|
|
08-04-17
|
조회 3,277
|
|
|
|
08-04-17
|
조회 3,607
|
|
|
|
08-04-17
|
조회 3,223
|
|
|
|
08-04-17
|
조회 3,704
|
|
|
|
08-04-17
|
조회 5,063
|
|
|
|
08-04-17
|
조회 5,209
|
|
|
|
08-04-17
|
조회 3,414
|
|
|
|
08-04-16
|
조회 2,563
|
|
|
|
08-04-15
|
조회 2,691
|
|
|
|
08-04-14
|
조회 2,843
|
|
|
|
08-04-14
|
조회 2,826
|
|
|
|
08-04-11
|
조회 2,607
|
|
|
|
08-04-11
|
조회 2,741
|
|
|
|
08-04-11
|
조회 2,560
|
|
|
|
08-04-09
|
조회 3,170
|
|
|
관리자
|
08-04-08
|
조회 4,194
|
|
|
|
08-04-07
|
조회 3,106
|
|
|
|
08-04-07
|
조회 2,678
|
|
|
|
08-04-06
|
조회 2,944
|
|
|
|
08-04-06
|
조회 3,653
|
|
|
|
08-04-05
|
조회 3,234
|
|
|
|
08-04-05
|
조회 2,489
|
|
|
|
08-04-04
|
조회 7,292
|
|
|
|
08-04-04
|
조회 4,673
|
|
|
|
08-04-04
|
조회 4,575
|
|
|
|
08-04-04
|
조회 3,910
|
|
|
|
08-04-04
|
조회 4,116
|
|
|
|
08-04-04
|
조회 4,120
|
|
|
|
08-04-04
|
조회 4,577
|
|
|
|
08-04-04
|
조회 3,777
|
|
|
|
08-04-04
|
조회 3,916
|
|
|
|
08-04-04
|
조회 4,020
|
|
|
|
08-04-04
|
조회 3,954
|
|
|
|
08-04-04
|
조회 4,137
|
|
|
|
08-04-04
|
조회 4,673
|
|
|
|
08-04-04
|
조회 4,084
|
|
|
|
08-04-04
|
조회 2,918
|
|
|
|
08-04-04
|
조회 4,299
|
|
|
|
08-04-04
|
조회 3,007
|
|
|
|
08-04-04
|
조회 2,899
|
|
|
|
08-04-04
|
조회 3,393
|
|
|
|
08-04-04
|
조회 2,920
|
|
|
|
08-04-04
|
조회 2,797
|
|
|
|
08-04-04
|
조회 2,777
|
|
|
|
08-04-04
|
조회 3,003
|
|
|
|
08-04-04
|
조회 3,468
|
|
|
|
08-04-04
|
조회 2,809
|
|
|
|
08-04-04
|
조회 2,825
|
|
|
|
08-04-04
|
조회 2,645
|
|
|
|
08-04-04
|
조회 2,823
|
|
|
|
08-04-04
|
조회 2,652
|
|
|
|
08-04-04
|
조회 2,718
|
|
|
|
08-04-04
|
조회 3,045
|
|
|
|
08-04-04
|
조회 2,877
|
|
|
|
08-04-04
|
조회 2,743
|
|
|
|
08-04-04
|
조회 2,706
|
|
|
|
08-04-04
|
조회 2,784
|
|
|
|
08-04-04
|
조회 2,611
|
|
|
|
08-04-04
|
조회 2,654
|
|
|
|
08-04-04
|
조회 2,686
|
|
|
|
08-04-04
|
조회 2,755
|
|
|
|
08-04-04
|
조회 2,775
|
|
|
|
08-04-04
|
조회 2,861
|
|
|
|
08-04-04
|
조회 2,768
|
|
|
|
08-04-04
|
조회 3,126
|
|
|
|
08-04-04
|
조회 4,263
|
|
|
|
08-04-03
|
조회 4,686
|
|
|
|
08-04-03
|
조회 2,774
|
|
|
|
08-04-03
|
조회 2,908
|
|
|
|
08-04-03
|
조회 2,693
|
|
|
|
08-04-03
|
조회 3,552
|
|
|
|
08-04-03
|
조회 4,382
|
|
|
|
08-04-03
|
조회 2,658
|
|
|
|
08-04-03
|
조회 2,571
|
|
|
|
08-04-03
|
조회 2,820
|
|
|
|
08-04-03
|
조회 2,752
|
|
|
|
08-04-03
|
조회 2,915
|
|
|
|
08-04-03
|
조회 2,889
|
|
|
|
08-04-03
|
조회 2,766
|
|
|
|
08-04-03
|
조회 4,022
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^