2.0版本,调整框架,不再兼容以前版本

This commit is contained in:
JAE
2014-06-12 14:58:02 +08:00
parent 3b7078a1ac
commit 2d757b6ad2
5 changed files with 102 additions and 28 deletions

View File

@@ -6,7 +6,7 @@ $url = "http://www.oschina.net/code/list";
$reg = array("title"=>array(".code_title a:eq(0)","text"),"url"=>array(".code_title a:eq(0)","href"),"author"=>array("img","title"));
$rang = ".code_list li";
//使用curl抓取源码并以GB2312编码格式输出
$hj = new QueryList($url,$reg,$rang,'curl','GB2312');
$hj = QueryList::Query($url,$reg,$rang,'curl','GB2312');
$arr = $hj->jsonArr;
echo "<pre>";
print_r($arr);
@@ -21,7 +21,7 @@ echo $json . "<hr/>";
//采OSC内容页内容
$url = "http://www.oschina.net/code/snippet_186288_23816";
$reg = array("title"=>array(".QTitle h1","text"),"con"=>array(".Content","html"));
$hj = new QueryList($url,$reg);
$hj = QueryList::Query($url,$reg);
$arr = $hj->jsonArr;
echo "<pre>";
print_r($arr);