📄 freecj.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!-- #include file="check.asp" -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>http://cj.idczzz.cn采集同步程序</title><LINK href="admin.css" type=text/css rel=stylesheet>
</head><body>
<div align="center">
<%
Function GetContent(str,start,last,n)
If Instr(lcase(str),lcase(start))>0 then
select case n
case 0 '左右都截取(都取前面)(去处关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)+1)
GetContent=Left(GetContent,Instr(lcase(GetContent),lcase(last))-1)
case 1 '左右都截取(都取前面)(保留关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))+1)
GetContent=Left(GetContent,Instr(lcase(GetContent),lcase(last))+Len(last)-1)
case 2 '只往右截取(取前面的)(去除关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)+1)
case 3 '只往右截取(取前面的)(包含关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))+1)
case 4 '只往左截取(取后面的)(包含关键字)
GetContent=Left(str,InstrRev(lcase(str),lcase(start))+Len(start)-1)
case 5 '只往左截取(取后面的)(去除关键字)
GetContent=Left(str,InstrRev(lcase(str),lcase(start))-1)
case 6 '只往左截取(取前面的)(包含关键字)
GetContent=Left(str,Instr(lcase(str),lcase(start))+Len(start)-1)
case 7 '只往右截取(取后面的)(包含关键字)
GetContent=Right(str,Len(str)-InstrRev(lcase(str),lcase(start))+1)
case 8 '只往左截取(取前面的)(去除关键字)
GetContent=Left(str,Instr(lcase(str),lcase(start))-1)
case 9 '只往右截取(取后面的)(包含关键字)
GetContent=Right(str,Len(str)-InstrRev(lcase(str),lcase(start)))
case 10 '左右都截取(都取前面)(保留关键字)
GetContent=Left(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)-1)
GetContent=Right(GetContent,Instr(lcase(GetContent),lcase(last))+1)
end select
Else
GetContent=""
End if
End function
Function ssdh()
zt_name=Request.QueryString("zt_name")
response.write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"" class=""tableBorder""><th colspan=8>以下是你搜索的数据</th><tr><td colspan=8 class=forumrow><div align=""center""><font color=#FF0000>(直接点击影片名称进行采集)</font></div></td></tr>"
ss_dh=Geturl("http://cj.idczzz.cn/cj/dh.asp")
ss_dh1=Split(ss_dh,"----")
For dh1=0 To UBound(ss_dh1)-1
ss_dhdq1=GetContent(ss_dh1(dh1),"<1>","<11>",0)
urla=GetContent(ss_dh1(dh1),"<2>","<22>",0)
cj_picurl=GetContent(ss_dh1(dh1),"<3>","<33>",0)
ss_dhdq=Geturl(ss_dhdq1&"?zt_name="&zt_name)
ss_dh2=Split(ss_dhdq,"----")
For dh2=0 To UBound(ss_dh2)-1
zt_name1=GetContent(ss_dh2(dh2),"<1>","<11>",0)
zt_dy=GetContent(ss_dh2(dh2),"<2>","<22>",0)
zt_id=GetContent(ss_dh2(dh2),"<3>","<33>",0)
response.write"<form action=""?urla="&urla&"&cj_picurl="&cj_picurl&"&action=update&zt_id="&zt_id&""" method=""post""><tr><td class=forumrow><font color=#FF0000>"&zt_id&"</font></td><td class=forumrow><font color=#FF0000>"&zt_name1&"</font></td><td class=forumrow>"&item&"</td><td class=forumrow><input type=""submit"" value=""采集入库"" /></td><td class=forumrow><font color=#FF0000>"&zt_dy&"</font></td></form>"
next
next
End Function
Function GetURL(URL)
Set http=Server.CreateObject("Microsoft.XMLHTTP")
On Error Resume Next
http.Open "GET",URL,False
http.send()
if Err then
Err.Clear
Response.Write("没有找到网页!")
Response.End()
End if
getHTTPPage=bytesToBSTR(Http.responseBody,"gb2312")
set http=nothing
GetURL=getHTTPPage
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 cut(str,start,start_num,over,over_num)
cut=mid(str,Instr(str,start)+start_num,Instr(str,over)+over_num-Instr(str,start)-start_num)
End Function
Function item
item="<select size=""1"" name=""key""><option value=0>选择本地分类</option>"
set rs1=conn.execute("select * from zt_type order by zt_typeid asc")
If rs1.eof Or rs1.bof Then
item=item&"出错了"
response.End
End If
while not rs1.eof
item=item&"<option value="&rs1("zt_typeid")&">"&rs1("zt_typename")&"</option>"
rs1.movenext
wend
rs1.close
set rs1=Nothing
item=item&"</select>"
end Function
urla=Request.QueryString("urla")
cj_picurl=Request.QueryString("cj_picurl")
if urla="" and Request.QueryString("zt_name")="" then
%>
<font color="#af4532">请自行选择采集服务器</font></br>
</br>
<script type="text/javascript" language="javascript" src="http://cj.idczzz.cn/cj.js"></script>
</br>
</br>
<%
Response.End
end if
%>
<%
maxz_url=urla
if Request.QueryString("zt_name")<>"" then
ssdh
response.End
end if
If request("action")="update" or Request.QueryString("action")="update" Then
if request.Form("zt_id")="" then
zt_id= Request.QueryString("zt_id")
else
zt_id=Replace(request.Form("zt_id"),", ",",")
end if
zt_key=request.Form("key")
maxz_urll=maxz_url&"?action=add&zt_id="&zt_id
maxz_urll=maxz_urll&"&a="&Request.ServerVariables("Http_Host")
maxz_urll=maxz_urll&"&b="&Request.ServerVariables("LOCAL_ADDR")
maxz_urll=maxz_urll&"&c="&maxz_23
maxz_cn_str=Geturl(maxz_urll)
If InStr(maxz_cn_str,"<!--1:s-->")<=0 Then
response.write maxz_cn_str
response.End
End If
maxz_cn_array=Split(maxz_cn_str,"|||||")
response.write"<table width=""100%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"" class=""tableBorder""><th colspan=8>采集结果</th>"
For i=0 To UBound(maxz_cn_array)-1
zt_name=cut(maxz_cn_array(i),"<!--1:s-->",10,"<!--1:e-->",0)
zt_type=cut(maxz_cn_array(i),"<!--2:s-->",10,"<!--2:e-->",0)
zt_zy=cut(maxz_cn_array(i),"<!--3:s-->",10,"<!--3:e-->",0)
zt_pic=cut(maxz_cn_array(i),"<!--4:s-->",10,"<!--4:e-->",0)
zt_dy=cut(maxz_cn_array(i),"<!--5:s-->",10,"<!--5:e-->",0)
zt_url=cut(maxz_cn_array(i),"<!--6:s-->",10,"<!--6:e-->",0)
zt_lz=cut(maxz_cn_array(i),"<!--7:s-->",10,"<!--7:e-->",0)
zt_content=cut(maxz_cn_array(i),"<!--8:s-->",10,"<!--8:e-->",0)
zt_dy1=cut(maxz_cn_array(i),"<!--9:s-->",10,"<!--9:e-->",0)
zt_url1=cut(maxz_cn_array(i),"<!--10:s-->",11,"<!--10:e-->",0)
pd=request.Form("pd")
if instr(zt_pic,"images/uploadimg/") then
zt_pic2=zt_pic
else
zt_pic2="images/uploadimg/" & zt_pic
end if
set rs=server.CreateObject("ADODB.RecordSet")
Sql="Select zt_name,zt_url,zt_lz,zt_dy,zt_dy1,zt_url1,zt_date,zt_content,zt_pic from zt_data Where zt_name='"&zt_name&"'"
Rs.Open Sql,Conn,1,3
if not Rs.Eof And not Rs.Bof Then
zt_pic1=rs("zt_pic")
if rs("zt_url")=zt_url Then
If rs("zt_url1")=zt_url1 Then
if instr(pd,"dz") or instr(pd,"tp") or instr(pd,"js") or instr(pd,"sj") or instr(pd,"fl") then
sm=""
if instr(pd,"dz") then
rs("zt_url1")=zt_url1
rs("zt_url")=zt_url
rs("zt_dy1")=zt_dy1
rs("zt_dy")=zt_dy
sm=sm & "#地址#"
rs.update
end if
if instr(pd,"tp") then
rs("zt_pic")=zt_pic2
sm=sm & "#图片#"
rs.update
end if
if instr(pd,"js") then
rs("zt_content")=zt_content
sm=sm & "#介绍#"
rs.update
end if
if instr(pd,"sj") then
rs("zt_date")=now()
sm=sm & "#时间#"
rs.update
end if
if instr(pd,"tp") then
Response.Write "<tr><td class=forumrow width=200>"&zt_name&"</td><td class=forumrow><font color='#FF0000'>强制更新"&sm&"成功</font></td><td><iframe border=0 valign=bottom vspace=0 hspace=0 marginwidth=0 marginheight=0 framespacing=0 frameborder=0 scrolling=no width=400 height=15 src=tool_ztpic1.asp?path=../"&zt_pic2&"&url="&cj_picurl&zt_pic&"></iframe></td></tr>"
Response.flush
else
Response.Write "<tr><td class=forumrow width=200>"&zt_name&"</td><td class=forumrow><font color='#FF0000'>强制更新"&sm&"成功</font></td></tr>"
Response.flush
end if
else
Response.Write "<tr><td class=forumrow width=200>"&zt_name&"</td><td class=forumrow><font color='#FF0000'>该片不需要更新</font></td></tr>"
Response.flush
end if
Else
if zt_url1<>"" then
rs("zt_dy1")=zt_dy1
rs("zt_url1")=zt_url1
rs("zt_date")=now
rs.update
Response.Write "<tr><td class=forumrow width=200>"&zt_name&"</td><td class=forumrow><font color='#FF0000'>该电影地址二有变动,已重新写入,同时更新了添加时间</font></td></tr>"
Response.flush
end if
Response.Write "<tr><td class=forumrow width=200>"&zt_name&"</td><td class=forumrow><font color='#FF0000'>该片不需要更新</font></td></tr>"
Response.flush
End If
Else
rs("zt_lz")=zt_lz
rs("zt_dy")=zt_dy
rs("zt_url")=zt_url
rs("zt_date")=now
If rs("zt_url1")<>zt_url1 Then
if zt_url1<>"" then
rs("zt_dy1")=zt_dy1
rs("zt_url1")=zt_url1
end if
end if
rs.update
Response.Write "<tr><td class=forumrow width=200>"&zt_name&"</td><td class=forumrow><font color='#FF0000'>该电影数据有变动,已重新写入数据,同时更新了添加时间</font></td></tr>"
Response.flush
end if
Else
If zt_key=0 Then
Response.Write"<tr><td><font color='#FF0000'>你没有选择本地分类,请重新采集</font></td></tr>"
response.write"<tr><td class=forumrow colspan=2><a href=""#"" onclick=""javascript:history.go(-1);"">恭喜,任务完成!返回</a>(图片下载完即可)</td></tr></table>"
Response.end
Else
zt_types=zt_key
End If
if zt_pic2 = "images/uploadimg/" then
conn.execute("insert into zt_data(zt_type,zt_name,zt_lz,zt_url,zt_content,zt_tj,zt_hits,zt_date,zt_url1,zt_dy1,zt_dy,zt_zy) values("&zt_types&",'"&zt_name&"','"&zt_lz&"','"&zt_url&"','"&zt_content&"',0,0,'"&now()&"','"&zt_url1&"','"&zt_dy1&"','"&zt_dy&"','"&zt_zy&"')")
Response.Write "<tr><td class=forumrow width=200>"&zt_name&"(<font color='#FF0000'>OK</font>)</td><td bgcolor=#DADAE9><font color=#ff0000>对不起!此影片没有图片<font></td></tr>"
else
conn.execute("insert into zt_data(zt_type,zt_name,zt_lz,zt_url,zt_content,zt_pic,zt_tj,zt_hits,zt_date,zt_url1,zt_dy1,zt_dy,zt_zy) values("&zt_types&",'"&zt_name&"','"&zt_lz&"','"&zt_url&"','"&zt_content&"','"&zt_pic2&"',0,0,'"&now()&"','"&zt_url1&"','"&zt_dy1&"','"&zt_dy&"','"&zt_zy&"')")
Response.Write "<tr><td class=forumrow width=200>"&zt_name&"(<font color='#FF0000'>OK</font>)</td><td bgcolor=#DADAE9><iframe border=0 valign=bottom vspace=0 hspace=0 marginwidth=0 marginheight=0 framespacing=0 frameborder=0 scrolling=no width=400 height=15 src=tool_ztpic1.asp?path=../"&zt_pic2&"&url="&cj_picurl&zt_pic&"></iframe></td></tr>"
end if
Response.flush
End If
Next
response.write"<tr><td class=forumrow colspan=2><a href=""#"" onclick=""javascript:history.go(-1);"">恭喜,任务完成!返回</a>(图片下载完即可)</td></tr></table>"
Response.end
End If
page=request("page")
If page="" Or page<1 Then
page=1
End If
zt_type=request("zt_type")
If zt_type="" Then
zt_type=0
End If
zt_dy=request("zt_dy")
maxz_cn_update_url=maxz_url & "?zt_type=" & zt_type & "&page=" & page & "&urla="&urla & "&cj_picurl="&cj_picurl & "&zt_dy="&zt_dy
response.write Replace(Geturl(maxz_cn_update_url),"<!--分类-->",item)
%>
</div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -