|
|
|
08-01-27
|
조회 3,804
|
|
|
|
08-01-26
|
조회 8,563
|
|
|
|
08-01-21
|
조회 3,312
|
|
|
|
08-01-08
|
조회 3,764
|
|
|
|
07-12-21
|
조회 4,705
|
|
|
|
07-12-14
|
조회 4,859
|
|
|
|
07-12-13
|
조회 6,306
|
|
|
관리자
|
07-12-10
|
조회 4,090
|
|
|
|
07-12-03
|
조회 3,249
|
|
|
|
07-12-03
|
조회 4,293
|
|
|
|
07-11-27
|
조회 5,788
|
|
|
|
07-11-26
|
조회 2,996
|
|
|
|
07-11-22
|
조회 5,112
|
|
|
관리자
|
07-11-21
|
조회 3,326
|
|
|
관리자
|
07-11-21
|
조회 1.1만
|
|
|
|
07-11-12
|
조회 4,071
|
|
|
|
07-11-07
|
조회 4,833
|
|
|
|
07-10-29
|
조회 3,584
|
|
|
|
07-10-25
|
조회 4,998
|
|
|
|
07-10-24
|
조회 3,791
|
|
|
|
07-10-23
|
조회 5,980
|
|
|
|
07-10-09
|
조회 4,142
|
|
|
|
07-10-09
|
조회 4,604
|
|
|
|
07-10-09
|
조회 3,201
|
|
|
|
07-10-09
|
조회 3,559
|
|
|
|
07-09-27
|
조회 3,862
|
|
|
|
07-09-27
|
조회 3,086
|
|
|
|
07-09-15
|
조회 4,015
|
|
|
|
07-09-13
|
조회 2,785
|
|
|
|
07-09-13
|
조회 3,248
|
|
|
|
07-08-07
|
조회 3,275
|
|
|
|
07-08-04
|
조회 3,419
|
|
|
|
07-07-30
|
조회 5,421
|
|
|
|
07-07-29
|
조회 3,786
|
|
|
|
07-07-29
|
조회 4,457
|
|
|
|
07-07-21
|
조회 3,101
|
|
|
|
07-07-20
|
조회 3,146
|
|
|
|
07-07-20
|
조회 4,305
|
|
|
|
07-07-07
|
조회 3,386
|
|
|
|
07-07-06
|
조회 5,208
|
|
|
|
07-07-06
|
조회 5,607
|
|
|
|
07-07-05
|
조회 6,746
|
|
|
|
07-07-04
|
조회 3,379
|
|
|
|
07-06-11
|
조회 3,898
|
|
|
|
07-06-04
|
조회 7,243
|
|
|
|
07-05-28
|
조회 4,872
|
|
|
|
07-05-14
|
조회 6,339
|
|
|
|
07-05-10
|
조회 5,284
|
|
|
|
07-05-09
|
조회 3,387
|
|
|
|
07-05-04
|
조회 3,684
|
|
|
|
07-04-27
|
조회 3,328
|
|
|
|
07-04-25
|
조회 4,648
|
|
|
|
07-04-19
|
조회 3,611
|
|
|
|
07-04-16
|
조회 3,217
|
|
|
|
07-04-13
|
조회 3,836
|
|
|
|
07-04-12
|
조회 4,557
|
|
|
|
07-04-12
|
조회 4,772
|
|
|
|
07-04-11
|
조회 3,401
|
|
|
|
07-04-08
|
조회 5,131
|
|
|
|
07-04-07
|
조회 3,235
|
|
|
|
07-03-29
|
조회 3,540
|
|
|
|
07-03-27
|
조회 3,747
|
|
|
|
07-03-21
|
조회 5,146
|
|
|
|
07-03-15
|
조회 3,282
|
|
|
|
07-03-11
|
조회 3,299
|
|
|
|
07-03-10
|
조회 4,938
|
|
|
|
07-03-09
|
조회 3,941
|
|
|
|
07-03-08
|
조회 4,822
|
|
|
|
07-03-05
|
조회 2,942
|
|
|
|
07-03-02
|
조회 3,032
|
|
|
|
07-03-02
|
조회 3,870
|
|
|
|
07-02-26
|
조회 2,918
|
|
|
|
07-02-26
|
조회 3,011
|
|
|
|
07-02-23
|
조회 4,261
|
|
|
|
07-02-23
|
조회 3,327
|
|
|
|
07-02-23
|
조회 3,328
|
|
|
|
07-02-23
|
조회 3,512
|
|
|
|
07-02-22
|
조회 3,151
|
|
|
|
07-02-21
|
조회 4,803
|
|
|
|
07-02-20
|
조회 4,602
|
|
|
|
07-02-14
|
조회 3,749
|
|
|
|
07-02-12
|
조회 5,340
|
|
|
|
07-02-11
|
조회 4,771
|
|
|
|
07-02-10
|
조회 4,079
|
|
|
|
07-02-09
|
조회 3,851
|
|
|
|
07-02-08
|
조회 4,518
|
|
|
|
07-02-03
|
조회 4,113
|
|
|
|
07-02-02
|
조회 3,488
|
|
|
|
07-01-09
|
조회 3,575
|
|
|
관리자
|
07-01-08
|
조회 3,943
|
|
|
|
06-12-26
|
조회 4,642
|
|
|
|
06-12-21
|
조회 3,751
|
|
|
|
06-12-15
|
조회 4,160
|
|
|
|
06-12-15
|
조회 7,439
|
|
|
|
06-12-15
|
조회 3,168
|
|
|
|
06-12-15
|
조회 3,188
|
|
|
|
06-12-15
|
조회 3,463
|
|
|
|
06-12-15
|
조회 3,119
|
|
|
|
06-12-15
|
조회 4,538
|
|
|
|
06-12-15
|
조회 3,136
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^