国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

可以查詢google排名的asp源碼

2024-05-04 11:01:57
字體:
來源:轉載
供稿:網友
以下是源碼,請命名為.ASP文件.

復制代碼 代碼如下:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<% 
if request("action") = "1" then 
 word = request("word") 
 url = request("url") 
 if word <> "" then 
  getCategories() 

  if url <> "" then 
   getCategories2() 
  end if 
 end if 
end if 

Function getCategories() 

response.write("<b>'"&word&"' 關鍵詞在Google搜索排名中,前10位網站!</b><br>") 

on error resume next 
Dim oXMLHTTP  
Dim oCategories  
Dim BodyText 
Dim Pos,Pos1 
Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP") 
http = "http://www.google.com/search?q="&word&"&hl=zh-CN" 
oXMLHTTP.open "GET",http,False   
oXMLHTTP.send  

 BodyText=oXMLHTTP.responsebody 
 BodyText=BytesToBstr(BodyText,"UTF-8") 
 Pos=Instr(BodyText,"<body") 
 pos1=Instr(BodyText,"</body>") 
 BodyText=mid(BodyText,pos,pos1) 

 Pos = Instr(BodyText,"<div>") 
 BodyText = Mid(BodyText,Pos) 
 pos1=Instr(BodyText,"</div>") 
 BodyText=mid(BodyText,1,pos1) 
 'response.write ("::::"&BodyText&"::::") 

 BodyText=split(BodyText,"<p class=g>") 

 for i = 1 to 10 
  Pos=Instr(BodyText(i),"</a>") 
  thet = Mid(BodyText(i),1,Pos+3)  

  Pos = Instr(BodyText(i),"<span dir=ltr>") 
  theu = Mid(BodyText(i),Pos) 
  pos1=Instr(theu,"</span>") 
  theu=mid(theu,1,pos1-1) 

  response.write("T:"&thet&"<br>") 
  response.write("U:"&theU&"<br><hr>") 

 next 

Set oXMLHTTP = Nothing  
if err.number<>0 then 
response.write "出錯了,錯誤描述:"&err.description & "<br>錯誤來源"& err.source 
response.End() 
end if 
End Function  


Function getCategories2() 
on error resume next 
Dim oXMLHTTP ' As Object 
Dim oCategories ' As Object 
Dim BodyText 
Dim Pos,Pos1 
Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP") 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 同德县| 凤阳县| 洛扎县| 三原县| 汝阳县| 枣庄市| 枣强县| 买车| 文登市| 洪湖市| 石景山区| 大连市| 五常市| 仪陇县| 新源县| 綦江县| 卓尼县| 毕节市| 塔河县| 客服| 陵川县| 云龙县| 额敏县| 彭水| 天峻县| 石嘴山市| 明水县| 麻江县| 斗六市| 南丹县| 辛集市| 扶余县| 北海市| 安陆市| 高雄市| 通许县| 新乡市| 静安区| 敖汉旗| 黔西| 会同县|