更新google scholar匹配规则

This commit is contained in:
wlx 2012-05-11 04:15:50 +00:00
parent 6fcfcd539e
commit 37f895de71
1 changed files with 2 additions and 2 deletions

View File

@ -999,7 +999,7 @@ class ServiceController extends Zend_Controller_Action
$max = 5;
$error='';
if(preg_match_all("#<h3>(.+?)<\/h3>#im",$html,$matchs,PREG_PATTERN_ORDER))
if(preg_match_all("#<h3.*?>(.+?)<\/h3>#im",$html,$matchs,PREG_PATTERN_ORDER))
{
foreach ($matchs[0] as $k=>$v){
if($k < $max) $rev[$k]['title']=utf8_encode($v);
@ -1008,7 +1008,7 @@ class ServiceController extends Zend_Controller_Action
$error = "无搜索结果";
}
if(preg_match_all("!<span class=gs_a>(.*?)<\/span>!im",$html,$matchs,PREG_PATTERN_ORDER))
if(preg_match_all('!<div class="gs_a">(.*?)<\/div>!im',$html,$matchs,PREG_PATTERN_ORDER))
{
foreach ($matchs[0] as $k=>$v){
if($k < $max) $rev[$k]['content']=utf8_encode($v);