今天无聊来进行BaiduSubmit的改造,将原本提交文章链接改造成为提交mip页面的链接,代码如下:
$wtf = count($urls);
for ($x=0; $x<=$wtf; $x++) {
$urls[$x] = str_replace(".com/",".com/mip/",$urls[$x]);
if ( strpos ($urls[$x],"/share") !== false){
$urls[$x] = str_replace("/share","",$urls[$x]);
} elseif (strpos ($urls[$x],"/record") !== false){
$urls[$x] = str_replace("/record","",$urls[$x]);
} elseif (strpos ($urls[$x],"/chuiB") !== false){
$urls[$x] = str_replace("/chuiB","",$urls[$x]);
} else {
$urls[$x] = str_replace("/Tech-Otakus","",$urls[$x]);
}
}
可能写的有点水,但是可以成功的将https://www.caixiaojing.com/share/bilibili.html改造成为https://www.caixiaojing.com/mip/bilibili.html。这样便完成了BaiduSubmit For Typecho的MIP页面提交改造。