关键词 匹配转义

hotfix/远程访问多媒体中心
lyt 8 years ago
parent 8d8b8bcae7
commit 85fad91ba1

@ -449,11 +449,11 @@ class Keyworlds extends CI_Controller {
//抓取google搜索结果 //抓取google搜索结果
$url = "https://www.$google_url/search?q=$search_worlds&start=$start&num=50&hl=$language"; $url = "https://www.$google_url/search?q=$search_worlds&start=$start&num=50&hl=$language";
$match_fun = '/<h3 class="r">(.*)<\/h3>/smUi'; $match_fun = '/<h3 class=\"r\">(.*)<\/h3>/smUi';
$rank_flag = 'rank'; $rank_flag = 'rank';
$source_flag = 'source'; $source_flag = 'source';
if ($client_flag == 'm') { if ($client_flag == 'm') {
$match_fun = '/<a class="_Olt _bCp"(.*)<div/smUi'; $match_fun = '/<a class=\"_Olt _bCp\"(.*)<div/smUi';
$rank_flag = 'rank_m'; $rank_flag = 'rank_m';
$source_flag = 'source_m'; $source_flag = 'source_m';
} }
@ -517,7 +517,7 @@ class Keyworlds extends CI_Controller {
$rank_flag = 'rank'; $rank_flag = 'rank';
$source_flag = 'source'; $source_flag = 'source';
if ($client_flag == 'm') { if ($client_flag == 'm') {
$match_fun = '/<a class="link link_theme_normal organic__url i-bem"(.*)class=/smUi'; $match_fun = '/<a class=\"link link_theme_normal organic__url i-bem\"(.*)class=/smUi';
$rank_flag = 'rank_m'; $rank_flag = 'rank_m';
$source_flag = 'source_m'; $source_flag = 'source_m';
} }
@ -663,8 +663,8 @@ class Keyworlds extends CI_Controller {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent); curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
// curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
// curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理 curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理
if ($referer) { if ($referer) {
curl_setopt($ch, CURLOPT_REFERER, $referer); curl_setopt($ch, CURLOPT_REFERER, $referer);
} }

Loading…
Cancel
Save