|
|
|
08-01-27
|
조회 3,812
|
|
|
|
08-01-26
|
조회 8,574
|
|
|
|
08-01-21
|
조회 3,324
|
|
|
|
08-01-08
|
조회 3,774
|
|
|
|
07-12-21
|
조회 4,715
|
|
|
|
07-12-14
|
조회 4,870
|
|
|
|
07-12-13
|
조회 6,313
|
|
|
관리자
|
07-12-10
|
조회 4,213
|
|
|
|
07-12-03
|
조회 3,259
|
|
|
|
07-12-03
|
조회 4,301
|
|
|
|
07-11-27
|
조회 5,796
|
|
|
|
07-11-26
|
조회 3,006
|
|
|
|
07-11-22
|
조회 5,122
|
|
|
관리자
|
07-11-21
|
조회 3,335
|
|
|
관리자
|
07-11-21
|
조회 1.1만
|
|
|
|
07-11-12
|
조회 4,077
|
|
|
|
07-11-07
|
조회 4,845
|
|
|
|
07-10-29
|
조회 3,589
|
|
|
|
07-10-25
|
조회 5,004
|
|
|
|
07-10-24
|
조회 3,799
|
|
|
|
07-10-23
|
조회 5,993
|
|
|
|
07-10-09
|
조회 4,151
|
|
|
|
07-10-09
|
조회 4,620
|
|
|
|
07-10-09
|
조회 3,213
|
|
|
|
07-10-09
|
조회 3,569
|
|
|
|
07-09-27
|
조회 3,873
|
|
|
|
07-09-27
|
조회 3,098
|
|
|
|
07-09-15
|
조회 4,025
|
|
|
|
07-09-13
|
조회 2,795
|
|
|
|
07-09-13
|
조회 3,261
|
|
|
|
07-08-07
|
조회 3,284
|
|
|
|
07-08-04
|
조회 3,430
|
|
|
|
07-07-30
|
조회 5,437
|
|
|
|
07-07-29
|
조회 3,796
|
|
|
|
07-07-29
|
조회 4,467
|
|
|
|
07-07-21
|
조회 3,113
|
|
|
|
07-07-20
|
조회 3,153
|
|
|
|
07-07-20
|
조회 4,332
|
|
|
|
07-07-07
|
조회 3,395
|
|
|
|
07-07-06
|
조회 5,216
|
|
|
|
07-07-06
|
조회 5,616
|
|
|
|
07-07-05
|
조회 6,756
|
|
|
|
07-07-04
|
조회 3,385
|
|
|
|
07-06-11
|
조회 3,906
|
|
|
|
07-06-04
|
조회 7,254
|
|
|
|
07-05-28
|
조회 4,878
|
|
|
|
07-05-14
|
조회 6,345
|
|
|
|
07-05-10
|
조회 5,294
|
|
|
|
07-05-09
|
조회 3,398
|
|
|
|
07-05-04
|
조회 3,693
|
|
|
|
07-04-27
|
조회 3,337
|
|
|
|
07-04-25
|
조회 4,660
|
|
|
|
07-04-19
|
조회 3,622
|
|
|
|
07-04-16
|
조회 3,228
|
|
|
|
07-04-13
|
조회 3,845
|
|
|
|
07-04-12
|
조회 4,568
|
|
|
|
07-04-12
|
조회 4,781
|
|
|
|
07-04-11
|
조회 3,408
|
|
|
|
07-04-08
|
조회 5,140
|
|
|
|
07-04-07
|
조회 3,242
|
|
|
|
07-03-29
|
조회 3,551
|
|
|
|
07-03-27
|
조회 3,759
|
|
|
|
07-03-21
|
조회 5,157
|
|
|
|
07-03-15
|
조회 3,290
|
|
|
|
07-03-11
|
조회 3,311
|
|
|
|
07-03-10
|
조회 4,947
|
|
|
|
07-03-09
|
조회 3,951
|
|
|
|
07-03-08
|
조회 4,834
|
|
|
|
07-03-05
|
조회 2,954
|
|
|
|
07-03-02
|
조회 3,039
|
|
|
|
07-03-02
|
조회 3,875
|
|
|
|
07-02-26
|
조회 2,932
|
|
|
|
07-02-26
|
조회 3,024
|
|
|
|
07-02-23
|
조회 4,268
|
|
|
|
07-02-23
|
조회 3,333
|
|
|
|
07-02-23
|
조회 3,340
|
|
|
|
07-02-23
|
조회 3,521
|
|
|
|
07-02-22
|
조회 3,156
|
|
|
|
07-02-21
|
조회 4,808
|
|
|
|
07-02-20
|
조회 4,612
|
|
|
|
07-02-14
|
조회 3,760
|
|
|
|
07-02-12
|
조회 5,354
|
|
|
|
07-02-11
|
조회 4,789
|
|
|
|
07-02-10
|
조회 4,090
|
|
|
|
07-02-09
|
조회 3,861
|
|
|
|
07-02-08
|
조회 4,527
|
|
|
|
07-02-03
|
조회 4,123
|
|
|
|
07-02-02
|
조회 3,502
|
|
|
|
07-01-09
|
조회 3,587
|
|
|
관리자
|
07-01-08
|
조회 3,957
|
|
|
|
06-12-26
|
조회 4,654
|
|
|
|
06-12-21
|
조회 3,758
|
|
|
|
06-12-15
|
조회 4,166
|
|
|
|
06-12-15
|
조회 7,447
|
|
|
|
06-12-15
|
조회 3,176
|
|
|
|
06-12-15
|
조회 3,198
|
|
|
|
06-12-15
|
조회 3,473
|
|
|
|
06-12-15
|
조회 3,137
|
|
|
|
06-12-15
|
조회 4,542
|
|
|
|
06-12-15
|
조회 3,141
|
댓글 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 가 나름 다루기 편해서입니다.
네발가락님 짱^^