Exemplo n.º 1
0
// 可折叠 可折叠列表不支持计数气泡
// 分页 显示更多
// 自动填入过滤常用词 新闻 通知 学术讲座
// 获取配置信息
$filter = isset($_GET['filter']) ? $_GET['filter'] : "week";
header("Content-type:text/html;charset=utf-8");
// 根据配置信息抓取数据
define('SPIDER_PATH', '../core/');
require_once SPIDER_PATH . 'php_web_spider.php';
require_once SPIDER_PATH . 'simple_html_dom.php';
// 会分析提交的UI配置信息
$sp = new Spider();
// $tmp = $sp-> fetch_news('http://www.phbs.pku.edu.cn/index.php?m=content&c=index&a=lists&catid=419');
// print_r($tmp);exit(0);
// 网址信息数据 建议从数据库中获取,相同学院只是不同path,根地址相同
$news['信息工程学院'] = $sp->fetch_news('http://www.ece.pku.edu.cn/index.php?m=content&c=index&a=lists&catid=502', $filter);
// 提供特殊形式链接
$news['汇丰商学院'] = $sp->fetch_news('http://www.phbs.pku.edu.cn/index.php?m=content&c=index&a=lists&catid=419', $filter);
// $news['化学生物学与生物技术学院'] = $sp-> fetch_news('http://www.scbb.pkusz.edu.cn/index.php?m=content&c=index&a=lists&catid=862');
// $news['环境与能源学院'] = $sp-> fetch_news('http://see.pkusz.edu.cn/news_cn.aspx');
// $news['城市规划与设计学院'] = $sp-> fetch_news('http://see.pkusz.edu.cn/news_cn.aspx');
// $news['城市规划与设计学院'] = $sp-> fetch_news('http://sam.pkusz.edu.cn/index.php?m=content&c=index&a=lists&catid=395');
// 讲座信息
$lecture['信息工程学院'] = $sp->fetch_news('http://www.ece.pku.edu.cn/index.php?m=content&c=index&a=lists&catid=503', $filter);
$lecture['汇丰商学院'] = $sp->fetch_news('http://www.phbs.pku.edu.cn/list-812-1.html', $filter);
// $lecture['新材料学院'] = $sp-> fetch_news('http://sam.pkusz.edu.cn/index.php?m=content&c=index&a=lists&catid=809');
// Undefined variable: find_link in D:\Program Files\xampp\htdocs\GitHub\php_web_spider\core\php_web_spider.php on line 259
// 添加拆分按钮
// foreach ($news as $key => $value) {
// 	# code...
// }