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

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 3793|回复: 1
收起左侧

[其他转载] asp批量取链接标题~呵呵

[复制链接]
zhan170 发表于 2015-3-17 23:06
[HTML] 纯文本查看 复制代码
<%Server.ScriptTimeOut=999999%>
<!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>
<style type="text/css">
.zuo{position: absolute;left:10px;top:10px;}
.you{position: absolute;left:420px;top:10px;}
.anniu{position: absolute;left:10px;top:420px;}
#toTop{background-image:url([img]http://mat1.gtimg.com/www/images/qq2012/qqbg_1.6.1.png[/img]); background-repeat:no-repeat;}
#toTop{width:54px;height:54px;display:block;position:fixed;right:25px;bottom:45px;background-position:-700px -110px;opacity:0.3;filter:alpha(opacity=30);}
#toTop:hover{opacity:1;filter:alpha(opacity=100);}
</style>
<script type="text/javascript" src="http://mat1.gtimg.com/www/asset/lib/jquery/jquery/jquery-1.11.1.min.js"></script>
<!--[if lte IE 6]>
<style type="text/css">
html,body{overflow-x:hidden;}
#toTop{position:absolute;right:15px;bottom:45px;}
</style>
<![endif]-->
<script type="text/javascript">
$(function(){
	$(window).scroll(function(){
        toTopHide();
        $("#toTop").click(function(){
            window.scrollTo(0,0);
            return false;
        });
    });
});
/*返回顶部*/
function toTopHide(){
    if(document.documentElement.scrollTop+document.body.scrollTop > 400){
        if(!(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent)))){
            document.getElementById("toTop").style.display = "block";
        }
    }else{
        document.getElementById("toTop").style.display = "none";
    }
}
</script>
<!--IE6脚本 开始-->
<!--[if lte IE 6]>
<script type="text/javascript">
function topFixed(){
	if(document.documentElement.scrollTop > 400){
		document.getElementById("toTop").style.display = "block";
	}else{
		document.getElementById("toTop").style.display = "none";
	}
	document.getElementById("toTop").style.top = (document.documentElement.clientHeight + document.documentElement.scrollTop - document.getElementById("toTop").clientHeight - 45) + "px";
}
$(function(){
	$(window).bind("scroll",function(){
		topFixed();
	});
	$(window).bind("resize",function(){
		topFixed();
	});
	$(function(){
		topFixed();
	});
});
</script>
<![endif]-->
<!--IE6脚本 结束-->
<body>
<%
on error resume next  
 If err then
 err.clear
 End If
Function GetOtherContent(Str,StartStr,LastStr)
    On Error Resume Next
    Dim RegEx,SearchStr,Matches,Matche
    Str = Replace(Replace(Str,Chr(13),""),Chr(10),"")
    StartStr = Replace(Replace(StartStr,Chr(13),""),Chr(10),"")
    LastStr = Replace(Replace(LastStr,Chr(13),""),Chr(10),"")
    SearchStr = StartStr & ".*" & LastStr
    Set RegEx = New RegExp
        RegEx.IgnoreCase = True
        RegEx.Global = True
        RegEx.Pattern = SearchStr
    Set Matches = RegEx.Execute(Str)
    For Each Matche In Matches
        If Matche <> "" Then
            GetOtherContent = Matche
            RegEx.Pattern = StartStr
            GetOtherContent = RegEx.Replace(GetOtherContent,"")
            RegEx.Pattern = LastStr & ".*|\n"
            GetOtherContent = RegEx.Replace(GetOtherContent,"")
        Else
            GetOtherContent = ""
        End If
        If Err.Number <> 0 Then
            Err.Clear
            GetOtherContent = "ai"
        End If
        Exit For
    Next
End Function


Function GetHttpPage(HttpUrl)
   Dim Http
   Set Http=server.createobject("MSX"&"ML2.XML"&"HTTP")
   Http.open "GET",HttpUrl,False
   Http.Send()
   If Http.Readystate<>4 then
      Set Http=Nothing
      Exit function
   End if
   'Shift-JIS
    if instr(LCase(http.ResponseText),"utf-8")>=1 Then
        GetHTTPPage=bytesToBSTR(Http.responseBody,"utf-8") '没有找到编码则转换为GB2312
    else
        GetHTTPPage=bytesToBSTR(Http.responseBody,"gb2312") '如果测试汉字失败那就是GB2312编码,用bytesToBSTR来转换responseBody的结果
    End if
   Set Http=Nothing
   If Err.number<>0 then
      Err.Clear
   End If
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 RegExpmsg(strng,strEX,strpp)
Set regEx = New RegExp ' 建立正则表达式。  
regEx.Pattern =strEX
regEx.IgnoreCase = True ' 设置是否区分字符大小写。 
regEx.Global = True ' 设置全局可用性。 
Set Matches = regEx.Execute(strng) ' 执行搜索。 
For Each Match in Matches ' 遍历匹配集合。 
RetStr = RetStr & Match.Value & strpp
Next 
RegExpmsg = RetStr 
End Function 



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

'当前网页的URL,不包含#及其后面部分
If LCase(Request.ServerVariables("HTTPS")) = "off" Then
strTemp = "http://"
Else
strTemp = "https://"
End If
strTemp = strTemp & Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("SERVER_PORT") <> 80 Then
strTemp = strTemp & ":" & Request.ServerVariables("SERVER_PORT")
end if
if Request.ServerVariables("Query_String") <> "" then
strTemp = strTemp & Request.ServerVariables("URL") &"?"& Request.ServerVariables("Query_String")
else
strTemp = strTemp & Request.ServerVariables("URL")
end if
%>

<form action="<%=strTemp%>" method=post>
<div class="zuo"><textarea name="wd" style="width:400px;height:400px;"></textarea></div>
<div class="you">
<%


dim shoulu,meishou
if ci<>"" then
startime=timer()
dedearr=split(ci,Chr(13)&chr(10)) '分割成数组
	if ubound(dedearr)=0 then
		dedeurl=dedearr(0)
		xx=dedeurl
		gethtmlcode=GetHttpPage(xx)
		'<div id="m-spread-left">
		yuedu=GetOtherContent(gethtmlcode,"<title>","</title>")
		'li=GetOtherContent(yuedu,"<li id=""first""","</li>")
		li=trim(yuedu)
		if len(li)>0 then
		response.write li&"<br>"
		shoulu=clng(shoulu)+1
		else
		
		meishou=clng(meishou)+1
		end if
	else
		shangxian=ubound(dedearr)
	end if
for dede=0 to shangxian-1 '数组长度减一,因为最后有两个chr(13)换行。

dedeurl=dedearr(dede)
if dedeurl<>"" then
	xx=""&dedeurl
	gethtmlcode=GetHttpPage(xx)
	'<div id="m-spread-left">
	yuedu=GetOtherContent(gethtmlcode,"<title>","</title>")
	li=trim(yuedu)
	if len(li)>0 then
	response.write li&"<br>"
	shoulu=clng(shoulu)+1
	else	
	meishou=clng(meishou)+1
	end if
end if
	for i=0 to 10000
	i=i+1
	next
next 
response.write "总标题"&shangxian&" 取到"&shoulu&" 取不到"&meishou&"<br>"
response.write "Script Execution Time:"&fix((timer()-startime)*1000)
end if
%>
</div>
<div class="anniu"><input type=submit value="360一下"></div>
</form>
<a href="javascript:void(0)" target="_self" id="toTop" title="返回顶部" style="display:none" bossZone="backtop"></a>
</body></html>

QQ截图20150317230509.png

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

MAXtoDEATH 发表于 2016-8-27 15:06
发错区系列
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

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

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

GMT+8, 2024-9-23 11:21

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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