吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2875|回复: 0
收起左侧

[其他转载] pc端链接批对移动端链接对应生成sogou站长开放设配中url匹配规则生成代码

[复制链接]
zhan170 发表于 2015-9-10 16:17
本帖最后由 zhan170 于 2015-9-10 16:20 编辑

[Visual Basic] 纯文本查看 复制代码
<!DOCTYPE html>
<html>
<head>
    <meta charset="gb2312">
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
    <meta name="viewport" content="width=device-width" />
    <title></title>
</head>
<body>
<%
Sub WriteToTextFile (FileUrl,byval Str,CharSet)
set stm=server.CreateObject("adodb.stream")
stm.Type=2 '以本模式读取
stm.mode=3
stm.charset=CharSet
stm.open
stm.Write str
stm.SaveToFile server.MapPath(FileUrl),2
stm.flush
stm.Close
set stm=nothing
end Sub
function AddLog(FileUrl,str)
filename=Server.MapPath(FileUrl)   
Set fs=CreateObject("Scripting.FileSystemObject")   
Set f=fs.OpenTextFile(filename,8,true)   
 
f.WriteLine(str)  
'写入文件中
f.close   
  set   f=nothing   
  set   fs=nothing
end function
%>
<h2>pc端链接批对移动端链接对应生成sogou站长开放设配中url匹配规则xml</h2>
<table>
<form action="360.asp" method=post>
<tr><td><strong>pc端</strong></td><td><strong>移动端</strong></td></tr>
<tr>
<td><textarea name="wd" style="width:400px;height:400px;"></textarea></td>
<td>
<textarea name="sj" style="width:400px;height:400px;"></textarea>
</td>
</tr>
<tr><td colspan=2><input type=submit value="生成"></td></tr>
</form>
</table>
<%

ci=trim(Request.form("wd"))
sj=trim(Request.form("sj"))

if ci<>"" and sj<>"" then
dedearr=split(ci,Chr(13)&chr(10)) '分割成数组
shouji=split(sj,Chr(13)&chr(10))
call AddLog("a.xml","<?xml version=""1.0"" encoding=""UTF-8"" ?>")
call AddLog("a.xml","<urlset>")
for dede=0 to ubound(dedearr)-1 '数组长度减一,因为最后有两个chr(13)换行。

dedeurl=dedearr(dede)
hm=shouji(dede)
call AddLog("a.xml","<url>"&Chr(13)&"<loc>"&dedearr(dede)&"</loc>"&Chr(13)&"<data>"&Chr(13)&"<display>"&Chr(13)&"<url_pattern>"&hm&"</url_pattern>"&Chr(13)&"<version>7</version>"&Chr(13)&"</display>"&Chr(13)&"</data>"&Chr(13)&"</url>")

next 
call AddLog("a.xml","</urlset>")

end if
%>
</body></html>


弄个小旋风复制源码成asp文件运行就ok了。

生成后文件内容:
[XML] 纯文本查看 复制代码
<?xml version="1.0" encoding="UTF-8" ?>
<urlset>
<url>
<loc>pc端链接</loc>
<data>
<display>
<url_pattern>移动端链接</url_pattern>
<version>7</version>
</display>
</data>
</url>
</urlset>




发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-9-23 01:32

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表