📄 抓取数据程序(indexy[1].asp).asp
字号:
<%
Server.ScriptTimeOut=9000%>
<!-- #include file="conn.asp"-->
<%if request("action")<>"" then%>
<%set rs=server.CreateObject("adodb.recordset")
sql="select * from pic"
rs.open sql,conn,1,3%>
<%function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "get",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function
Function bytes2BSTR(vIn)
dim strReturn
dim i1,ThisCharCode,NextCharCode
strReturn = ""
For i1 = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i1,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i1+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i1 = i1 + 1
End If
Next
bytes2BSTR = strReturn
End Function %>
<%dim shuzi,id1,id2
id1=request("id1")
id2=request("id2")
shuzi=id1
For shuzi=id1 To id2
%>
<%
dim id,page,cardtype,search,mj_top,mj_top0,mj_top1,mj_top2,mj_body,mj_b,mj_e,mj_diary,start1,over1,bt1,bt2,biaoti,js,js1,js2
on error resume next
subjectno=shuzi
url="http://www.vlike.com/flash/"&subjectno&".htm"
mj_code=getHTTPPage(url)
mj_top=mj_code
if err.number=0 then
bt1=Instr(mj_top,"<title>")
bt2=Instr(bt1,mj_top,"-")
biaoti=mid(mj_top,bt1+7,bt2-bt1-7)
sg1=Instr(mj_top,"作者")
sg2=Instr(sg1,mj_top,"<b>")
sg=mid(mj_top,sg1+7,sg2-sg1-7)
start=Instr(mj_top,"value=")
msgg=Instr(start,mj_top,">")
over=Instr(mj_top,"<param name=""quality""")
gg=msgg-start
mj_top=mid(mj_top,start+7,gg-8)
else
wscript.echo err.description
end if
%>
<%
if start>0 then
rs.addnew
rs("shuzi")=shuzi
rs("biaoti")=biaoti
rs("content")=mj_top
rs("sg")=sg
rs.update
end if%>
<%next%>
添加成功,吼吼,自己做美化吧!!!!
需要别功能自己搞哦,也可以叫我帮忙。。。
返回首页看看<a href="index.asp">首页</A>
<%else%>
<script>
function checkid(thefrm)
{
if (thefrm.id1.value==""||thefrm.id1.value=="")
{
alert("请输入范围!欢迎访问www.mmok.com")
return false
}
if (thefrm.id2.value-thefrm.id1.value>50)
{
alert("测试版仅提供两数据间距最大50!!欢迎访问www.mmok.com")
return false
}
return true
}
</script>
<form name="form1" method="post" action="indexy.asp?action=add" onsubmit="return checkid(this)">
<table width="800" border="1" align="center" cellpadding="0" cellspacing="1" bgcolor="CCCCCC" bordercolor=ffffff>
<tr>
<td colspan="2" align="center" bgcolor="">时空音乐www.mmok.com抓flash程序</td>
</tr>
<tr>
<td width="42%" rowspan="2" align="center" bgcolor="">选取ID范围</td>
<td width="58%" bgcolor=""> <input name="id1" type="text" id="id1" value="<%=Request.form("id1")%>" ></td>
</tr>
<tr>
<td bgcolor=""><input name="id2" type="text" id="id2" value="<%=Request.form("id2")%>" ></td>
</tr>
<tr>
<td align="center" bgcolor=""><a href="http://www.mmok.com/bbs" target="_blank">进入论坛</a></td>
<td bgcolor=""><input name="action" type="submit" id="action" value="提交"></td>
</tr>
<tr align="left">
<td colspan="2" bgcolor="" style="font-size:12px"><p><br>
说明:<br>
使用“<font color="#FF0000">MSXML2.XMLHTTP</font>”对象搜索远程服务器上的数据,并将其信息处理得到所需要的真实flash地址,flash名称。
<br> 使用方法:在ID范围内输入两个数字,后者大于前者,
<br>因为他网站上的flash资源编号是从id ,1678开始的,2591结束,<br>所以大家测试的时候请输入比1678大比2591小的数字,欢迎大家去我的小站讨论,<a href="http://www.mmok.com" target=_blank><font color=red>http://www.mmok.com</font></a><br>测试版本仅提供两者之差不大于50。<a href="http://www.mmok.com/bbs" target="_blank">欢迎进入论坛进行讨论和交流</a>
。</p>
<p align="center"><br>
<a href="http://www.mmok.com" target="_blank"><img src="http://www.mmok.com/img/logo.gif" alt="" width="88" height="31" border="0"></a>
<br>
</p></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="" style="font-size:12px">版权所有:
<a href="http://www.mmok.com" target="_blank"><font color="#FF0000"></font></a> Power
By 时空音乐</td>
</tr>
</table>
</form>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -