PHP代码判断网站是否已被360搜索收录?判断360收录页面状态

PHP代码判断网站是否已被360搜索收录?
<?php
function so_check_record($url)
{
    $header = array(
        "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "Accept-Encoding:gzip, deflate, br",
        "Accept-Language:zh-CN,zh;q=0.9",
        "Cache-Control:max-age=0",
        "Connection:keep-alive",
        "Cookie:QiHooGUID=FCB7A2B243A59E737FA28B6B1B1BBBA1.1576525012453; __guid=15484592.2896449192008056300.1576525011727.3687; soid=(vF)tJ4NkvIr2dZK9Q1Sz-B)t5RSdRIG0SVmOEV3; __md=0q01d0bef015765250117691065444a265090386362d170.8; dpr=1; isafe=1; webp=1; __huid=11WUABzEEKm%2BIPcQKPWMfVHBqVLQNbJMJaSINuFCXFWPg%3D; _S=giuqj0v76fm7fgv9av59ik7675; opqopq=53db1e4a49a81c0a5f753f6296b41201.1576527890; gtHuid=1; count=27",
        "Host:www.so.com",
        "Upgrade-Insecure-Requests:1",
        "User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 QIHU 360SE"
    );
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'https://www.so.com/s?q='.$url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
    curl_setopt($curl, CURLOPT_ENCODING, "gzip");
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
    $rs = curl_exec($curl);
    curl_close($curl);
    //如果抓取到的360结果中不存在【提交网址】这个关键词,则认为该页面已被360收录
    if (!preg_match_all('/提交网址/u', $rs, $matches))
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
echo so_check_record('https://www.ecshopok.com/category-13-b0.html');
?>

本文原创地址:https://www.ecshopok.com/article-573.html
版权所有 © 转载时必须以链接形式注明出处!

觉得本文对您有用,想收藏下来!方法很简单:请点击-〉
我们一直坚持白天工作、晚上熬夜更新资源,付出了巨大的精力和时间,其中的辛酸难以言述。

文章评论

暂无评论,来发表一个吧

发表 取消
充值有惊喜 ECSHOP插件网微信客服edait_cn