360搜索引擎自動收錄功能,官方提供了代碼,帶式,十分坑爹,沒有提供批量提交入口,只是提供了一段js代碼,關(guān)鍵是 一個(gè)js去下載另外一個(gè)js,document.write到文檔,然后再 重復(fù)2遍如此工作。
弱弱地問:為什么不像百度一樣提供 批量提交入口?
難道是,靠這個(gè)自動提交功能,搜集網(wǎng)站的數(shù)據(jù),比如document.refer等數(shù)據(jù)?這個(gè)也是比較流氓了吧?
據(jù)說360的搜索引擎目前在中國 市場占有率為20%以上,不知道真假,本人是十分懷疑的!
起碼本人基本只用谷歌!奈何在天朝還是基本用百度,小白還是太多太多的!
只好忍了,加360的自動收錄吧!
于是對代碼進(jìn)行一番改造!
官網(wǎng)的原始代碼如下:
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>')
官網(wǎng)提供的代碼進(jìn)過二次方document.write的代碼如下,這個(gè)js的代碼如下:
/**
* 360推送 @www.zhoulujun.cn
*/
function getPushSoUrl($url){
$token="970506d365e969bd0e92a2611c18678e";
return $str="http://s.#/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.#/so/zz.gif?url=".urlencode($url)."sid=". $this->token."token=".$this->getPushToken($url,$this->token);
}
}
*/
在 模板 phpcms/templates/default/content/ 比如show index 添加如下代碼:
img src="{getPushSoUrl($_SERVER['HTTP_HOST'].$url)}">
okay,驗(yàn)證下
和js的效果是一樣的。
收工,不知道官方對此方案態(tài)度如何,目前還沒有收到回復(fù),郵寄給官方發(fā)過郵寄和論壇、知乎都提問,無人問津啊
先干了再說吧!
您可能感興趣的文章:- Mysql實(shí)現(xiàn)簡易版搜索引擎的示例代碼
- MySQL全文索引實(shí)現(xiàn)簡單版搜索引擎實(shí)例代碼
- 詳細(xì)介紹基于MySQL的搜索引擎MySQL-Fullltext
- scrapy+flask+html打造搜索引擎的示例代碼
- python基于搜索引擎實(shí)現(xiàn)文章查重功能
- Python實(shí)戰(zhàn)之手寫一個(gè)搜索引擎
- Python大批量搜索引擎圖像爬蟲工具詳解
- php記錄搜索引擎爬行記錄的實(shí)現(xiàn)代碼
- Python無損音樂搜索引擎實(shí)現(xiàn)代碼
- 基于 Mysql 實(shí)現(xiàn)一個(gè)簡易版搜索引擎