360 search engine so automatically includes php rewriting scheme - suitable for cms such as phpcms

The 360 ​​search engine automatically includes the function, the official code is provided, and the tape is very pitiful. It does not provide a batch submission entry, but only provides a piece of js code. The key is to download one js to another js, document.write to the document, and then repeat. 2 times this works.

Weakly asked: Why not provide a batch submission portal like Baidu?

Could it be that, relying on this automatic submission function, collect website data, such as document.refer and other data? This is rather rogue, isn't it?

It is said that 360's search engine currently has a market share of more than 20% in China. I don't know if it is true or not. I am very suspicious!

At least I basically only use Google! However, in China, Baidu is still basically used, and there are still too many Xiaobai!

Had to endure, plus 360 automatic recording it!

So make some changes to the code!

The original code of the official website is as follows:

<script>(function(){
var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?970506d365e969bd0e92a2611c18678e":"https://jspassport.ssl.qhimg.com/11.0.1.js?970506d365e969bd0e92a2611c18678e";
document.write('<script src="' + src + '" id="sozz"><\/script>');
})();

 

http://js.passport.qihucdn.com/11.0.1.js?970506d365e969bd0e92a2611c18678e

document.write('<script charset="utf-8" src="http://s7.qhres.com/static/ab77b6ea7f3fbf79.js"></script>')

http://s7.qhres.com/static/ab77b6ea7f3fbf79.js

The code provided by the official website has entered the quadratic document.write code as follows, the code of this js is as follows:

(function (e) {
    function t(e) {
        var t = location.href, n = t.split("").reverse(), r = e.split(""), i = [];
        for (var s = 0, o = 16; s < o; s++)i.push(r[s] + (n[s] || ""));
        return i.join("")
    }

    var n = /([http|https]:\/\/[a-zA-Z0-9\_\.]+\.so\.com)/gi, r = e.location.href;
    if (r && !n.test(r) && window.navigator.appName) {
        var i = "//s.360.cn/so/zz.gif", s = document.getElementById("sozz"), o = s.src.split("?")[1], u = t(o), a = new Image;
        r && (i += "?url=" + encodeURIComponent(r)), o && (i += "&sid=" + o), u && (i += "&token=" + u), o && (a.src = i)
    }
})(window);

Analysis finds

The ultimate goal is to submit the img request, Nima, so, the transformation is as follows:

In the phpcms/libs/functions/ directory of phpcms v9, find the extention.func.php file and add the following code:

/**
 * 360推送 @www.zhoulujun.cn

 */
function getPushSoUrl($url){
    $token="970506d365e969bd0e92a2611c18678e";
    return $str="http://s.360.cn/so/zz.gif?url=".urlencode($url)."&sid=". $token."&token=".getPushToken($url,$token);
}
function getPushToken($url,$o){
    $n = str_split($url,1);
    $n=array_reverse($n);
    $r = str_split($o,1);
    $i=[];
    for($s=0,$o=16;$s<$o;$s++)
    {

        array_push($i,empty($n[$s])?$r[$s]:$r[$s].$n[$s]);
    }
    return implode($i);
}
/*
class push_so_url{
    private $token="970506d365e969bd0e92a2611c18678e";
    public  function setToken($token){
        $this->token=$token;
    }
//    function __construct($token) {
//        $this->token=$token;
//    }
    public function getPushToken($url,$o){
        $n = str_split($url,1);
        $n=array_reverse($n);
        $r = str_split($o,1);
        $i=[];
        for($s=0,$o=16;$s<$o;$s++)
        {

            array_push($i,empty($n[$s])?$r[$s]:$r[$s].$n[$s]);
        }
        return implode($i);
    }
    public function getImgUrl($url){
        return $str="http://s.360.cn/so/zz.gif?url=".urlencode($url)."&sid=". $this->token."&token=".$this->getPushToken($url,$this->token);
    }


}
*/

Add the following code to the template phpcms/templates/default/content/ such as show index:

<img src="{getPushSoUrl($_SERVER['HTTP_HOST'].$url)}">

okay, verify

And the effect of js is the same.

Handmade, I don't know what the official attitude is about this plan. I haven't received a reply yet. I have sent it to the official by mail, forums, and Zhihu. I have asked questions, but no one cares.

Let's do it first!

 

If reproduced, please indicate source:

Zhou Jun's personal website - 360 search engine so automatically includes php rewriting scheme - suitable for cms such as phpcms

http://www.zhoulujun.cn/zhoulujun/html/Operation/seo/2018_0426_8102.html

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324970738&siteId=291194637