|
|
|
07-10-19
|
조회 3,466
|
|
|
|
07-10-19
|
조회 3,226
|
|
|
|
07-10-19
|
조회 3,175
|
|
|
|
07-10-19
|
조회 2,878
|
|
|
|
07-10-19
|
조회 4,454
|
|
|
|
07-10-19
|
조회 5,820
|
|
|
|
07-10-19
|
조회 6,101
|
|
|
|
07-10-19
|
조회 3,486
|
|
|
|
07-10-19
|
조회 4,949
|
|
|
관리자
|
07-10-17
|
조회 4,599
|
|
|
|
07-10-17
|
조회 5,986
|
|
|
관리자
|
07-10-16
|
조회 4,610
|
|
|
|
07-10-15
|
조회 5,573
|
|
|
|
07-10-13
|
조회 5,249
|
|
|
|
07-10-09
|
조회 4,952
|
|
|
|
07-10-09
|
조회 4,287
|
|
|
|
07-10-09
|
조회 4,216
|
|
|
|
07-10-09
|
조회 4,772
|
|
|
|
07-10-09
|
조회 3,537
|
|
|
|
07-10-09
|
조회 3,319
|
|
|
|
07-10-09
|
조회 6,794
|
|
|
|
07-10-09
|
조회 3,945
|
|
|
|
07-10-09
|
조회 3,678
|
|
|
|
07-10-09
|
조회 3,999
|
|
|
|
07-10-09
|
조회 3,370
|
|
|
|
07-10-09
|
조회 4,409
|
|
|
|
07-10-08
|
조회 1.1만
|
|
|
|
07-10-05
|
조회 3,156
|
|
|
|
07-10-05
|
조회 4,080
|
|
|
|
07-10-03
|
조회 4,196
|
|
|
|
07-10-03
|
조회 3,400
|
|
|
|
07-10-03
|
조회 4,246
|
|
|
|
07-10-03
|
조회 5,263
|
|
|
|
07-10-03
|
조회 4,246
|
|
|
|
07-10-03
|
조회 3,647
|
|
|
|
07-10-03
|
조회 7,333
|
|
|
|
07-10-03
|
조회 4,914
|
|
|
|
07-10-03
|
조회 7,584
|
|
|
|
07-10-03
|
조회 3,681
|
|
|
|
07-10-03
|
조회 3,625
|
|
|
|
07-10-03
|
조회 3,630
|
|
|
|
07-10-03
|
조회 4,666
|
|
|
|
07-10-03
|
조회 4,621
|
|
|
|
07-10-03
|
조회 3,317
|
|
|
|
07-10-03
|
조회 5,178
|
|
|
|
07-10-03
|
조회 2,983
|
|
|
|
07-10-03
|
조회 2,652
|
|
|
|
07-10-03
|
조회 2,701
|
|
|
|
07-10-03
|
조회 2,910
|
|
|
|
07-10-03
|
조회 2,918
|
|
|
|
07-10-03
|
조회 4,735
|
|
|
|
07-10-02
|
조회 3,623
|
|
|
|
07-10-02
|
조회 3,155
|
|
|
|
07-10-02
|
조회 3,491
|
|
|
|
07-10-02
|
조회 5,796
|
|
|
|
07-10-02
|
조회 3,529
|
|
|
|
07-10-02
|
조회 4,155
|
|
|
|
07-10-02
|
조회 3,169
|
|
|
|
07-10-02
|
조회 4,836
|
|
|
|
07-10-02
|
조회 3,081
|
|
|
|
07-10-02
|
조회 8,914
|
|
|
|
07-10-02
|
조회 4,571
|
|
|
|
07-10-01
|
조회 2,535
|
|
|
|
07-10-01
|
조회 3,732
|
|
|
|
07-09-28
|
조회 4,758
|
|
|
|
07-09-28
|
조회 3,629
|
|
|
|
07-09-27
|
조회 3,529
|
|
|
|
07-09-27
|
조회 4,038
|
|
|
|
07-09-27
|
조회 5,080
|
|
|
|
07-09-27
|
조회 4,684
|
|
|
|
07-09-27
|
조회 3,820
|
|
|
|
07-09-27
|
조회 3,229
|
|
|
|
07-09-27
|
조회 3,284
|
|
|
|
07-09-27
|
조회 3,920
|
|
|
|
07-09-27
|
조회 3,253
|
|
|
|
07-09-15
|
조회 4,193
|
|
|
|
07-09-15
|
조회 2,909
|
|
|
|
07-09-13
|
조회 3,430
|
|
|
|
07-09-13
|
조회 2,951
|
|
|
|
07-09-13
|
조회 3,388
|
|
|
|
07-09-11
|
조회 3,621
|
|
|
|
07-09-09
|
조회 3,555
|
|
|
|
07-08-28
|
조회 3,497
|
|
|
|
07-08-28
|
조회 3,372
|
|
|
|
07-08-23
|
조회 4,676
|
|
|
|
07-08-22
|
조회 2,871
|
|
|
|
07-08-21
|
조회 4,657
|
|
|
|
07-08-21
|
조회 3,239
|
|
|
관리자
|
07-08-16
|
조회 6,511
|
|
|
|
07-08-07
|
조회 3,416
|
|
|
|
07-08-04
|
조회 3,543
|
|
|
|
07-08-04
|
조회 2,914
|
|
|
|
07-08-04
|
조회 3,326
|
|
|
|
07-08-04
|
조회 4,883
|
|
|
|
07-08-04
|
조회 2,728
|
|
|
|
07-08-04
|
조회 2,934
|
|
|
|
07-08-01
|
조회 5,570
|
|
|
|
07-08-01
|
조회 4,984
|
|
|
|
07-07-31
|
조회 4,448
|
|
|
|
07-07-31
|
조회 4,697
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^