📄 tool_maxz_cn.asp
字号:
<!--#include file="check.asp"--><!--#include file="../inc/conn.asp"--><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>马克斯数据同步程序</title><LINK href="admin.css" type=text/css rel=stylesheet></head><body><%function Geturl(url):dim Http:set Http=server.createobject("MSXML2.XMLHTTP"):Http.open "GET",url,false:Http.send():if Http.readystate<>4 then:exit function:end if:Geturl=bytesToBSTR(Http.responseBody,"gb2312"):set http=nothing:if err.number<>0 then err.Clear:End if:end Function:Function BytesToBstr(body,Cset):dim objstream:s="stream":set objstream = Server.CreateObject("adodb."&s):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:maxz_url="http://www.maxz.cn/share/":If request("action")="update" Then :zt_id=Replace(request.Form("zt_id"),", ",","):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=2>采集结果</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):set rs=server.CreateObject("ADODB.RecordSet"):Sql="Select zt_name,zt_url,zt_lz,zt_dy,zt_dy1,zt_url1,zt_date from zt_data Where zt_name='"&zt_name&"'":Rs.Open Sql,Conn,1,3:if not Rs.Eof And not Rs.Bof Then:if rs("zt_url")=zt_url Then:If rs("zt_url1")=zt_url1 Then :Response.Write "<tr><td class=forumrow width=200>"&zt_name&"</td><td class=forumrow><font color='#FF0000'>该片不需要更新</font></td></tr>":Response.flush:Else :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 :Else:rs("zt_lz")=zt_lz:rs("zt_dy")=zt_dy:rs("zt_url")=zt_url: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:Else:If zt_key=0 Then :zt_types=zt_type:Else :zt_types=zt_key:End If: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_dy,zt_zy,zt_dy1,zt_url1) values("&zt_types&",'"&zt_name&"','"&zt_lz&"','"&zt_url&"','"&zt_content&"','"&zt_pic&"',0,0,'"&now()&"','"&zt_dy&"','"&zt_zy&"','"&zt_dy1&"','"&zt_url1&"')"):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_ztpic.asp?path=../"&zt_pic&"&url="&maxz_url&""&zt_pic&"></iframe></td></tr>":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 :maxz_cn_update_url=maxz_url&"?zt_type="&zt_type&"&page="&page:response.write Replace(Geturl(maxz_cn_update_url),"<!--分类-->",item):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%></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -