李存信事件:别人给我介绍一个生成GG地图的文件基于PHP语言的!不知道能不能用??还是其它的更好的方法呢?
来源:百度文库 编辑:高校问答 时间:2024/04/28 21:26:58
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%
Url="F:\seo\map\TGH2F7.tmp.htm" '可以是网站,也可以是文件目录,但文件一定是要用Xenu的htm文件
siteurl="http://www.yourname" '你的域名,主要是过滤外部链接
Html = getHTTPPage(Url)
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<a href=""" & siteurl & ".+?TARGET=""Xenu"">.+?</a>"
Set Matches=objRegExp.Execute(Html)
set fso=Server.CreateObject("Scripting.FileSystemObject")
set hf=fso.CreateTextFile(Server.mappath("sitemap.xml"),true)
hf.write "<?xml version='1.0' encoding='UTF-8'?>" & vbcrlf
hf.write "<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'>" & vbcrlf
For Each Match in Matches
Result = replace(Match.Value,"TARGET=""Xenu"">","|")
if instr(Result,"|")>0 then
Result=right(Result,len(Result)-instr(Result,"|"))
else
response.Write "程序出错..."
response.End()
end if
Result = replace(Result,"</a>","")
response.Write Result & "<br>" & vbcrlf
Result =replace(Result,chr(38),"&")
Result =replace(Result,chr(39),"'")
Result =replace(Result,chr(34),""")
Result =replace(Result,chr(60),"<")
Result =replace(Result,chr(62),">")
hf.write "<url>" & vbcrlf
hf.write "<loc>" & Result & "</loc>" & vbcrlf
hf.write "<lastmod>" & Date & "</lastmod>" & vbcrlf
hf.write "<changefreq>daily</changefreq>" & vbcrlf
hf.write "<priority>1.0</priority>" & vbcrlf
hf.write "</url>" & vbcrlf
Next
hf.write "</urlset>"
hf.close
set hf=nothing
set fso=nothing
response.Write "网站地图生成成功!"
%>
</body>
</html>
<%
Function getHTTPPage(url)
Set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
If Http.readystate<>4 Then
Exit Function
End If
getHTTPPage=bytesToBSTR(Http.responseBody,"utf-8")
Set http = Nothing
If err.number<>0 Then err.Clear
End Function
Function BytesToBstr(body,Cset)
Dim objstream
Set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
Set objstream = nothing
End Function
%>
文件说明
1、选择设置xenu的参数。
选项->偏号设置...
打开对话框,在报告区域里面只保留 有效文字链接 一选项,其他全部不选择
2、生成htm文件
文件->检查网址...
在地址栏里输入你要生成地图的网址
3、等待...
4、生成并打开报告
5、在map.asp中设置参数
6、运行map.asp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%
Url="F:\seo\map\TGH2F7.tmp.htm" '可以是网站,也可以是文件目录,但文件一定是要用Xenu的htm文件
siteurl="http://www.yourname" '你的域名,主要是过滤外部链接
Html = getHTTPPage(Url)
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<a href=""" & siteurl & ".+?TARGET=""Xenu"">.+?</a>"
Set Matches=objRegExp.Execute(Html)
set fso=Server.CreateObject("Scripting.FileSystemObject")
set hf=fso.CreateTextFile(Server.mappath("sitemap.xml"),true)
hf.write "<?xml version='1.0' encoding='UTF-8'?>" & vbcrlf
hf.write "<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'>" & vbcrlf
For Each Match in Matches
Result = replace(Match.Value,"TARGET=""Xenu"">","|")
if instr(Result,"|")>0 then
Result=right(Result,len(Result)-instr(Result,"|"))
else
response.Write "程序出错..."
response.End()
end if
Result = replace(Result,"</a>","")
response.Write Result & "<br>" & vbcrlf
Result =replace(Result,chr(38),"&")
Result =replace(Result,chr(39),"'")
Result =replace(Result,chr(34),""")
Result =replace(Result,chr(60),"<")
Result =replace(Result,chr(62),">")
hf.write "<url>" & vbcrlf
hf.write "<loc>" & Result & "</loc>" & vbcrlf
hf.write "<lastmod>" & Date & "</lastmod>" & vbcrlf
hf.write "<changefreq>daily</changefreq>" & vbcrlf
hf.write "<priority>1.0</priority>" & vbcrlf
hf.write "</url>" & vbcrlf
Next
hf.write "</urlset>"
hf.close
set hf=nothing
set fso=nothing
response.Write "网站地图生成成功!"
%>
</body>
</html>
<%
Function getHTTPPage(url)
Set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
If Http.readystate<>4 Then
Exit Function
End If
getHTTPPage=bytesToBSTR(Http.responseBody,"utf-8")
Set http = Nothing
If err.number<>0 Then err.Clear
End Function
Function BytesToBstr(body,Cset)
Dim objstream
Set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
Set objstream = nothing
End Function
%>
文件说明
1、选择设置xenu的参数。
选项->偏号设置...
打开对话框,在报告区域里面只保留 有效文字链接 一选项,其他全部不选择
2、生成htm文件
文件->检查网址...
在地址栏里输入你要生成地图的网址
3、等待...
4、生成并打开报告
5、在map.asp中设置参数
6、运行map.asp
运行
兄弟, 这是 ASP 的
XHTML +ASP
别人给我介绍一个生成GG地图的文件基于PHP语言的!不知道能不能用??还是其它的更好的方法呢?
WINDOWS的HL文件P生成的GID文件是什么?
我想学习基于linux平台的软件编程,请介绍几本书给我!
如何给一个文件加密码啊?我不想让别人看我的文件!!
给我一个CS带路点文件的awp_ice world 的地图,谢了
·给我一个CS带路点文件的awp_ice world 的地图,谢了
我要一个免费的网络硬盘..可以给我上传文件,给别人下载的
帮帮忙 给我介绍一个2D的中等配置(cpu pⅡ700)的武侠网络游戏
我的桌面上自动生成一个名为“1”的文件 删除后又生成这是怎么回事??
魔兽争霸在进入一个房间别人传地图给我走100的那儿总是10几就卡住