搜索引擎优化 测试PR值代码!可以扩展!

发布时间:2007年03月07日      浏览次数:1307 次
搜索引擎优化 测试PR值代码!可以扩展!
采用了xml技术(也是一个小偷程序),效果见首页左下角,你可以测试一下效果!可别忘了,输入格式如:www.txiang88.com!
部分核心代码:
<%
On Error Resume Next
Server.ScriptTimeOut=9999999
Function getHTTPPage(Path)
wxt = GetBody(Path)
getHTTPPage=BytesToBstr(wxtt,"GB2312")
End function
Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
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
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
%><%
ID = Request.QueryString("url")
url="http://rankwhere.com/google-page-rank. ... amp;id&""
wstr=getHTTPPage(url)
start=Newstring(wstr," has Google ")
over=Newstring(wstr,"NOTE")
body=mid(wstr,start+0,over-start-10)
body = replace(body,"has Google PageRank","")
body = replace(body,"out of 10","")
body = replace(body,"</b>","")
response.Write(""&id&"的PR值:")
response.write body
else response.write "请重新搜索<br>"
end if
%>
同样取google收录:
<%id=request("id")
url="http://www.google.com/search?hl=zh-CN&ie=UT ... uot;&id&""
wstr=getHTTPPage(url)
if instr(wstr,"请检查输入字词有无错误") then
none="google暂时没有收录 "&id&" 请点击</font><a href=""http://www.google.com/intl/zh-CN/add_url.html"& ... ot;"_blank"">这里</a><font size=""-1"">登陆您的网站。</font><br>"
response.write ""&none&""
else
start=Newstring(wstr,"</b> 上")
over=Newstring(wstr,"</b> 秒)")
body=mid(wstr,start+0,over-start)
body = replace(body,"</b> 上约有 ",""&id&" 在google上的搜索结果:找到网页约</font><a font='#FB5E3C'>")
body = replace(body,"</b> 上共有 ",""&id&" 在google上的搜索结果:找到网页共")
body = replace(body,"项符合<b></b>的查询结果,以下是第","</font><font size=""-1"">篇,请看")
body = replace(body,"(搜索用时 <b>","用时")
body = replace(body,"(搜索用时 <b>","用时")
response.write body
response.write "秒。</font><a href=""http://www.google.com/search?q=site%3A"&request("domain") ... arget=""_blank""> 点击察看详细内容</a><br>"
end if
%>
免责声明:本站相关技术文章信息部分来自网络,目的主要是传播更多信息,如果您认为本站的某些信息侵犯了您的版权,请与我们联系,我们会即时妥善的处理,谢谢合作!