|
|
|
08-04-03
|
조회 3,930
|
|
|
|
08-04-03
|
조회 2,724
|
|
|
|
08-04-02
|
조회 2,925
|
|
|
|
08-04-02
|
조회 2,805
|
|
|
|
08-04-02
|
조회 3,121
|
|
|
|
08-04-02
|
조회 3,077
|
|
|
|
08-04-02
|
조회 3,108
|
|
|
|
08-04-02
|
조회 3,058
|
|
|
|
08-04-02
|
조회 2,751
|
|
|
|
08-04-02
|
조회 2,745
|
|
|
|
08-04-02
|
조회 2,841
|
|
|
|
08-04-02
|
조회 3,139
|
|
|
|
08-04-02
|
조회 3,042
|
|
|
|
08-04-02
|
조회 2,824
|
|
|
|
08-04-02
|
조회 2,964
|
|
|
|
08-04-02
|
조회 2,623
|
|
|
|
08-04-02
|
조회 2,874
|
|
|
|
08-04-02
|
조회 3,192
|
|
|
|
08-04-02
|
조회 4,000
|
|
|
|
08-04-02
|
조회 3,212
|
|
|
|
08-03-31
|
조회 2,519
|
|
|
관리자
|
08-03-31
|
조회 3,087
|
|
|
|
08-03-31
|
조회 3,588
|
|
|
|
08-03-29
|
조회 2,720
|
|
|
|
08-03-28
|
조회 3,425
|
|
|
|
08-03-28
|
조회 2,925
|
|
|
|
08-03-28
|
조회 2,590
|
|
|
|
08-03-27
|
조회 2,417
|
|
|
관리자
|
08-03-26
|
조회 3,309
|
|
|
관리자
|
08-03-26
|
조회 4,258
|
|
|
|
08-03-25
|
조회 3,732
|
|
|
|
08-03-25
|
조회 2,746
|
|
|
|
08-03-25
|
조회 4,080
|
|
|
|
08-03-25
|
조회 3,590
|
|
|
|
08-03-25
|
조회 4,014
|
|
|
|
08-03-25
|
조회 4,040
|
|
|
|
08-03-25
|
조회 3,703
|
|
|
|
08-03-25
|
조회 3,601
|
|
|
|
08-03-25
|
조회 2,851
|
|
|
|
08-03-25
|
조회 3,606
|
|
|
|
08-03-25
|
조회 5,299
|
|
|
|
08-03-21
|
조회 2,960
|
|
|
|
08-03-19
|
조회 5,125
|
|
|
|
08-03-18
|
조회 2,984
|
|
|
|
08-03-16
|
조회 2,947
|
|
|
|
08-03-14
|
조회 3,251
|
|
|
|
08-03-13
|
조회 3,653
|
|
|
|
08-03-13
|
조회 2,620
|
|
|
|
08-03-11
|
조회 2,948
|
|
|
|
08-03-11
|
조회 3,493
|
|
|
|
08-03-11
|
조회 2,991
|
|
|
|
08-03-11
|
조회 2,952
|
|
|
|
08-03-11
|
조회 2,753
|
|
|
|
08-03-11
|
조회 2,597
|
|
|
|
08-03-11
|
조회 2,530
|
|
|
|
08-03-11
|
조회 2,331
|
|
|
|
08-03-11
|
조회 2,361
|
|
|
|
08-03-11
|
조회 2,399
|
|
|
|
08-03-11
|
조회 2,370
|
|
|
|
08-03-11
|
조회 2,780
|
|
|
|
08-03-11
|
조회 2,858
|
|
|
|
08-03-08
|
조회 3,071
|
|
|
|
08-03-07
|
조회 4,197
|
|
|
|
08-03-07
|
조회 3,295
|
|
|
|
08-03-07
|
조회 2,961
|
|
|
|
08-03-06
|
조회 3,301
|
|
|
|
08-03-06
|
조회 3,058
|
|
|
|
08-03-06
|
조회 4,740
|
|
|
|
08-03-05
|
조회 2,679
|
|
|
|
08-03-04
|
조회 2,824
|
|
|
|
08-03-04
|
조회 2,527
|
|
|
|
08-03-04
|
조회 3,381
|
|
|
|
08-03-03
|
조회 4,353
|
|
|
|
08-02-28
|
조회 3,444
|
|
|
|
08-02-27
|
조회 2,931
|
|
|
|
08-02-22
|
조회 4,261
|
|
|
|
08-02-22
|
조회 5,646
|
|
|
|
08-02-22
|
조회 2,912
|
|
|
|
08-02-21
|
조회 4,583
|
|
|
|
08-02-21
|
조회 2,799
|
|
|
|
08-02-21
|
조회 4,797
|
|
|
|
08-02-21
|
조회 7,093
|
|
|
|
08-02-21
|
조회 2,599
|
|
|
|
08-02-21
|
조회 3,357
|
|
|
|
08-02-20
|
조회 3,026
|
|
|
|
08-02-19
|
조회 2,699
|
|
|
|
08-02-19
|
조회 3,566
|
|
|
|
08-02-19
|
조회 3,774
|
|
|
|
08-02-15
|
조회 2,749
|
|
|
|
08-02-15
|
조회 3,933
|
|
|
|
08-02-14
|
조회 4,437
|
|
|
|
08-02-14
|
조회 2,648
|
|
|
|
08-02-12
|
조회 3,103
|
|
|
|
08-02-11
|
조회 5,092
|
|
|
|
08-02-09
|
조회 5,823
|
|
|
|
08-02-09
|
조회 3,021
|
|
|
|
08-02-08
|
조회 2,881
|
|
|
|
08-02-05
|
조회 3,877
|
|
|
|
08-02-04
|
조회 3,091
|
|
|
|
08-02-03
|
조회 5,385
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^