require("./simple_html_dom.php");
require("../Snoopy.class.php");
$p = $_GET['page'];
$url = 'https://sports.news.naver.com/kbaseball/vod/index.nhn?page='.$p;
//$content = file_get_contents($url);
$snoopy = new snoopy;
$snoopy->agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
$snoopy->referer = "http://naver.com/";
$snoopy->fetch($url);
$content = $snoopy->results;
$html = new simple_html_dom();
$html->load($content);
//$html = iconv('euc-kr', 'utf-8', $html); // 한글이 깨질 때 사용
//echo $html;
$i = 0;
$j=0;
$k =0;
$count = 0;
$count1=0;
$count2=0;
$realUrl[20];
$realName[20];
$realSpan[20];
$realSpanW[20];
$page;
$page_day;
$list = $html->find('.video_list li');
$realList1 = $html->find('.type06 li');
$realList2 = $html->find('.paging ');
$realList3 = $html->find('.pagenavi_day ');
echo '';
foreach($list as $item)
{
$Url = $item->find(' a',0)->href;
$Name = $item->find(' a',0)->plaintext;
$Url = 'http://sports.news.naver.com'.$Url;
$Url = str_replace("category=&", "", $Url);
$Url = str_replace("&date=&gameId=&teamCode=&playerId=&keyword=","",$Url);
echo ''.$Name.'';
}
echo '
';
$j = ($p/10);
$j = (int)$j;
$j= $j*10;
$next = $j+11;
for($i=$j+1;$i<=$next;$i++)
{
if($i == $p)
echo ''.$i.'
';
else
{
if($i == $next)
echo ''.'다음'.'';
else
echo ''.$i.'';
}
}
echo '
';
?>