Allblog 명예의 전당글 가져오기를 예로...
http://search.dyd.cc/simplereader.php
http://www.nzeo.com/bbs/zboard.php?id=p_study&no=1267
http://www.nzeo.com/bbs/zboard.php?id=p_study&no=1269
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Rss 읽어오기</title>
<style>
body {margin:0px 10px 3px 10px;padding:0}
body,td,select {font-family:Verdana,Gulim;font-size:9pt;}
td {overflow:hidden;text-overflow:ellipsis;}
td.description p {margin:0;padding:3 0 3 0;}
a.lnk1:link,a.lnk1:visited,a.lnk1:hover {color:#0000ff;text-decoration:underline;}
a.lnk2:link,a.lnk2:visited {color:#808080;text-decoration:none;}
a.lnk2:hover {text-decoration:underline;}
a.lnk3:link {color:#0000ff;text-decoration:none;}
a.lnk3:visited {color:#800080;text-decoration:none;}
a.lnk3:hover {text-decoration:underline;}
a.lnk4:link,a.lnk4:visited {color:#D2691E;text-decoration:none;}
a.lnk4:hover {text-decoration:underline;}
a.lnk5:link,a.lnk5:visited {color:#0000ff;text-decoration:none;}
a.lnk5:hover {background-color:#eeeeee;}
.header1 {font-weight:bold;font-size:12pt;}
.btn_submit1 {border:1px solid gray;width:40;height:20;background-color:white;font-family:Gulim;font-size:9pt;padding:2 0 0 0}
.btn_submit2 {border:1px solid #c0c0c0;width:34;height:18;background-color:white;font-family:Gulim;font-size:8pt;line-height:12pt}
</style>
<base target=_blank>
</head>
<body bgcolor='#ffffff'>
<?php
//올블로그 명예의전당 rss 글내용이 하루에 한번만 바뀝니다.
$url = "http://www.allblog.net/Rss/BestPosts.xml";
$result = file($url);
$text = implode("\n", $result);
if(!empty($text)){
$item = explode("<item>", $text);
$count = count($item);
echo "
<table width=100% border=0 cellpadding=0 cellspacing=0 style=\"table-layout:fixed;\">
<tr><td>
<table width=100% border=0 cellpadding=0 cellspacing=0 style=\"table-layout:fixed;\">
<tr>
<td align=right valign=top style=\"padding:0 4 0 0;font-size:8pt;color:gray\" nowrap>총 <b>" . ($count - 1) . "</b>개 | 최종업데이트: " . date("Y-m-d H:i") . "</td>
</tr>
</table>
</td></tr>
<tr><td height=4></td></tr>
</table>
";
if (is_array($item) && count($item) > 1) {
for ($i = 1; $i < $count; $i++){
preg_match_all("`<title>(.+)</title><link>(.+)</link><source url=\".+\">(.+)</source><category>([^<]+)</category>(<category>([^<]+)</category>)?(<category />)?<pubDate>(.+)</pubDate><description><!\[CDATA\[(.+)\]\]></description>`s", $item[$i], $matches);
if (is_array($matches[1]) && count($matches[1]) > 0) {
foreach($matches[1] as $key => $val){
$title = (!empty($val)) ? $val : '';
$link = (!empty($matches[2][$key])) ? $matches[2][$key] : '';
$source = (!empty($matches[3][$key])) ? $matches[3][$key] : '';
$category1 = (!empty($matches[4][$key])) ? $matches[4][$key] : '';
$category2 = (!empty($matches[6][$key])) ? $matches[6][$key] : '';
$category = (!empty($category1) && !empty($category2)) ? $category1 . ", " . $category2 : $category1 . $category2;
$pubDate = (!empty($matches[8][$key])) ? date("Y-m-d H:i", strtotime($matches[8][$key])) : '';
$description = (!empty($matches[9][$key])) ? $matches[9][$key] : '';
$description_len = number_format(strlen($description));
if (!preg_match("`(<\s*\t*img\s*\t*|<\s*\t*a\s*\t*href)`i", $description)) $description = strip_tags(str_replace(array("<", ">", "<br /><hr />위 내용은 올블로그가 올블로그에 등록한 블로그로부터 수집하여 서버에 저장하고 있는 내용의 전체 또는 일부 입니다. 이 게시물에 대한 모든 저작권과 책임은 해당 블로그의 등록자에게 있습니다."), array("<", ">", ""), $description)) . "<br /><hr />위 내용은 올블로그가 올블로그에 등록한 블로그로부터 수집하여 서버에 저장하고 있는 내용의 전체 또는 일부 입니다. 이 게시물에 대한 모든 저작권과 책임은 해당 블로그의 등록자에게 있습니다.";
echo "
<a href=\"" . $link . "\"></a>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td bgcolor=#bdb76b><img width=1 height=1 alt=\"\"></td></tr>
<tr><td bgcolor=#ebebd5 style='padding:5 2 6 2'>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style=\"font-size:10pt\"><a href=\"" . $link . "\"><span style=\"font-weight:bold\">" . $title . "</span></a></td></tr>
</table>
</td></tr>
<tr><td style='padding:4 2 0 2'>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style='font-size:8pt;'> <font color=#808080>" . $pubDate . " 작성 <font color=#808080>| " . $category . "</font> <font color=#808080>| " . $description_len . "byte</font></font></td><td align=right style=\"font-family:Gulim;font-size:8pt;\" nowrap> </td></tr>
</table>
</td></tr>
</table>
<table id=\"desc_9612007\" width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style='padding:6 2 0 2;line-height:14pt;' class=description>" . $description . "</td></tr>
<tr><td height=10></td></tr>
</table>
<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td height=12></td></tr></table>
";
}
}
}
}
}
?>
</body>
</html>
http://search.dyd.cc/simplereader.php
http://www.nzeo.com/bbs/zboard.php?id=p_study&no=1267
http://www.nzeo.com/bbs/zboard.php?id=p_study&no=1269
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Rss 읽어오기</title>
<style>
body {margin:0px 10px 3px 10px;padding:0}
body,td,select {font-family:Verdana,Gulim;font-size:9pt;}
td {overflow:hidden;text-overflow:ellipsis;}
td.description p {margin:0;padding:3 0 3 0;}
a.lnk1:link,a.lnk1:visited,a.lnk1:hover {color:#0000ff;text-decoration:underline;}
a.lnk2:link,a.lnk2:visited {color:#808080;text-decoration:none;}
a.lnk2:hover {text-decoration:underline;}
a.lnk3:link {color:#0000ff;text-decoration:none;}
a.lnk3:visited {color:#800080;text-decoration:none;}
a.lnk3:hover {text-decoration:underline;}
a.lnk4:link,a.lnk4:visited {color:#D2691E;text-decoration:none;}
a.lnk4:hover {text-decoration:underline;}
a.lnk5:link,a.lnk5:visited {color:#0000ff;text-decoration:none;}
a.lnk5:hover {background-color:#eeeeee;}
.header1 {font-weight:bold;font-size:12pt;}
.btn_submit1 {border:1px solid gray;width:40;height:20;background-color:white;font-family:Gulim;font-size:9pt;padding:2 0 0 0}
.btn_submit2 {border:1px solid #c0c0c0;width:34;height:18;background-color:white;font-family:Gulim;font-size:8pt;line-height:12pt}
</style>
<base target=_blank>
</head>
<body bgcolor='#ffffff'>
<?php
//올블로그 명예의전당 rss 글내용이 하루에 한번만 바뀝니다.
$url = "http://www.allblog.net/Rss/BestPosts.xml";
$result = file($url);
$text = implode("\n", $result);
if(!empty($text)){
$item = explode("<item>", $text);
$count = count($item);
echo "
<table width=100% border=0 cellpadding=0 cellspacing=0 style=\"table-layout:fixed;\">
<tr><td>
<table width=100% border=0 cellpadding=0 cellspacing=0 style=\"table-layout:fixed;\">
<tr>
<td align=right valign=top style=\"padding:0 4 0 0;font-size:8pt;color:gray\" nowrap>총 <b>" . ($count - 1) . "</b>개 | 최종업데이트: " . date("Y-m-d H:i") . "</td>
</tr>
</table>
</td></tr>
<tr><td height=4></td></tr>
</table>
";
if (is_array($item) && count($item) > 1) {
for ($i = 1; $i < $count; $i++){
preg_match_all("`<title>(.+)</title><link>(.+)</link><source url=\".+\">(.+)</source><category>([^<]+)</category>(<category>([^<]+)</category>)?(<category />)?<pubDate>(.+)</pubDate><description><!\[CDATA\[(.+)\]\]></description>`s", $item[$i], $matches);
if (is_array($matches[1]) && count($matches[1]) > 0) {
foreach($matches[1] as $key => $val){
$title = (!empty($val)) ? $val : '';
$link = (!empty($matches[2][$key])) ? $matches[2][$key] : '';
$source = (!empty($matches[3][$key])) ? $matches[3][$key] : '';
$category1 = (!empty($matches[4][$key])) ? $matches[4][$key] : '';
$category2 = (!empty($matches[6][$key])) ? $matches[6][$key] : '';
$category = (!empty($category1) && !empty($category2)) ? $category1 . ", " . $category2 : $category1 . $category2;
$pubDate = (!empty($matches[8][$key])) ? date("Y-m-d H:i", strtotime($matches[8][$key])) : '';
$description = (!empty($matches[9][$key])) ? $matches[9][$key] : '';
$description_len = number_format(strlen($description));
if (!preg_match("`(<\s*\t*img\s*\t*|<\s*\t*a\s*\t*href)`i", $description)) $description = strip_tags(str_replace(array("<", ">", "<br /><hr />위 내용은 올블로그가 올블로그에 등록한 블로그로부터 수집하여 서버에 저장하고 있는 내용의 전체 또는 일부 입니다. 이 게시물에 대한 모든 저작권과 책임은 해당 블로그의 등록자에게 있습니다."), array("<", ">", ""), $description)) . "<br /><hr />위 내용은 올블로그가 올블로그에 등록한 블로그로부터 수집하여 서버에 저장하고 있는 내용의 전체 또는 일부 입니다. 이 게시물에 대한 모든 저작권과 책임은 해당 블로그의 등록자에게 있습니다.";
echo "
<a href=\"" . $link . "\"></a>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td bgcolor=#bdb76b><img width=1 height=1 alt=\"\"></td></tr>
<tr><td bgcolor=#ebebd5 style='padding:5 2 6 2'>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style=\"font-size:10pt\"><a href=\"" . $link . "\"><span style=\"font-weight:bold\">" . $title . "</span></a></td></tr>
</table>
</td></tr>
<tr><td style='padding:4 2 0 2'>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style='font-size:8pt;'> <font color=#808080>" . $pubDate . " 작성 <font color=#808080>| " . $category . "</font> <font color=#808080>| " . $description_len . "byte</font></font></td><td align=right style=\"font-family:Gulim;font-size:8pt;\" nowrap> </td></tr>
</table>
</td></tr>
</table>
<table id=\"desc_9612007\" width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style='padding:6 2 0 2;line-height:14pt;' class=description>" . $description . "</td></tr>
<tr><td height=10></td></tr>
</table>
<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td height=12></td></tr></table>
";
}
}
}
}
}
?>
</body>
</html>
'정보기술 > 일반' 카테고리의 다른 글
Google Analytics (0) | 2006.09.11 |
---|---|
Synchronize Google Calendar With Outlook (0) | 2006.09.11 |
scskusbf.sys 오류 (0) | 2006.09.05 |
TatterTools 0.9x, 0.97(클래식-classic) 에서 1.0으로 갈아타기 안내 (0) | 2006.09.01 |
Tatter 업그레이드 (0) | 2006.09.01 |