|
|
|
08-06-19
|
조회 2,417
|
|
|
|
08-06-15
|
조회 3,165
|
|
|
|
08-06-15
|
조회 2,403
|
|
|
|
08-06-14
|
조회 2,741
|
|
|
|
08-06-14
|
조회 3,628
|
|
|
|
08-06-14
|
조회 3,323
|
|
|
|
08-06-12
|
조회 2,206
|
|
|
|
08-06-11
|
조회 2,237
|
|
|
|
08-06-11
|
조회 2,335
|
|
|
|
08-06-11
|
조회 7,367
|
|
|
|
08-06-11
|
조회 7,103
|
|
|
관리자
|
08-06-08
|
조회 3,284
|
|
|
|
08-06-07
|
조회 2,214
|
|
|
|
08-06-05
|
조회 2,338
|
|
|
|
08-06-05
|
조회 3,317
|
|
|
|
08-06-05
|
조회 2,680
|
|
|
|
08-06-05
|
조회 2,338
|
|
|
|
08-06-05
|
조회 2,361
|
|
|
|
08-06-04
|
조회 2,280
|
|
|
|
08-06-03
|
조회 2,280
|
|
|
|
08-06-03
|
조회 5,358
|
|
|
|
08-06-03
|
조회 3,589
|
|
|
관리자
|
08-06-02
|
조회 2,884
|
|
|
|
08-06-02
|
조회 4,025
|
|
|
|
08-06-01
|
조회 2,641
|
|
|
|
08-05-31
|
조회 2,342
|
|
|
|
08-05-31
|
조회 2,353
|
|
|
|
08-05-31
|
조회 2,433
|
|
|
|
08-05-30
|
조회 2,310
|
|
|
|
08-05-29
|
조회 2,451
|
|
|
|
08-05-29
|
조회 3,714
|
|
|
헌이
|
08-05-27
|
조회 5,555
|
|
|
|
08-05-26
|
조회 2,393
|
|
|
|
08-05-26
|
조회 5,303
|
|
|
|
08-05-25
|
조회 5,387
|
|
|
|
08-05-24
|
조회 2,453
|
|
|
|
08-05-23
|
조회 3,468
|
|
|
|
08-05-23
|
조회 2,868
|
|
|
관리자
|
08-05-23
|
조회 4,633
|
|
|
|
08-05-22
|
조회 2,626
|
|
|
|
08-05-21
|
조회 4,980
|
|
|
|
08-05-21
|
조회 4,754
|
|
|
|
08-05-21
|
조회 3,906
|
|
|
|
08-05-20
|
조회 4,504
|
|
|
|
08-05-20
|
조회 4,093
|
|
|
|
08-05-20
|
조회 3,319
|
|
|
|
08-05-20
|
조회 4,581
|
|
|
|
08-05-20
|
조회 3,937
|
|
|
|
08-05-20
|
조회 4,830
|
|
|
|
08-05-19
|
조회 2,363
|
|
|
|
08-05-16
|
조회 3,490
|
|
|
|
08-05-15
|
조회 2,551
|
|
|
|
08-05-15
|
조회 2,389
|
|
|
|
08-05-15
|
조회 2,379
|
|
|
|
08-05-14
|
조회 2,309
|
|
|
|
08-05-13
|
조회 2,768
|
|
|
|
08-05-13
|
조회 4,172
|
|
|
관리자
|
08-05-13
|
조회 4,596
|
|
|
|
08-05-09
|
조회 4,368
|
|
|
|
08-05-08
|
조회 3,125
|
|
|
|
08-05-08
|
조회 5,280
|
|
|
|
08-05-08
|
조회 2,633
|
|
|
|
08-05-07
|
조회 2,332
|
|
|
|
08-05-07
|
조회 2,480
|
|
|
|
08-05-07
|
조회 2,287
|
|
|
|
08-05-01
|
조회 2,608
|
|
|
|
08-05-01
|
조회 2,962
|
|
|
|
08-04-29
|
조회 3,805
|
|
|
관리자
|
08-04-28
|
조회 3,623
|
|
|
|
08-04-26
|
조회 2,635
|
|
|
|
08-04-26
|
조회 2,381
|
|
|
|
08-04-26
|
조회 3,647
|
|
|
|
08-04-25
|
조회 4,076
|
|
|
|
08-04-23
|
조회 4,509
|
|
|
|
08-04-22
|
조회 4,449
|
|
|
|
08-04-22
|
조회 3,608
|
|
|
|
08-04-22
|
조회 5,166
|
|
|
|
08-04-22
|
조회 4,546
|
|
|
|
08-04-22
|
조회 6,925
|
|
|
|
08-04-22
|
조회 3,997
|
|
|
|
08-04-21
|
조회 3,135
|
|
|
|
08-04-21
|
조회 3,189
|
|
|
|
08-04-21
|
조회 3,127
|
|
|
|
08-04-21
|
조회 2,960
|
|
|
|
08-04-21
|
조회 4,072
|
|
|
|
08-04-20
|
조회 3,236
|
|
|
|
08-04-20
|
조회 2,920
|
|
|
|
08-04-20
|
조회 3,453
|
|
|
|
08-04-19
|
조회 2,346
|
|
|
|
08-04-18
|
조회 3,053
|
|
|
관리자
|
08-04-18
|
조회 4,395
|
|
|
|
08-04-17
|
조회 3,611
|
|
|
|
08-04-17
|
조회 3,062
|
|
|
|
08-04-17
|
조회 3,283
|
|
|
|
08-04-17
|
조회 2,570
|
|
|
|
08-04-17
|
조회 2,970
|
|
|
|
08-04-17
|
조회 2,450
|
|
|
|
08-04-17
|
조회 3,006
|
|
|
|
08-04-17
|
조회 3,061
|
|
|
|
08-04-17
|
조회 2,268
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^