📄 db_con_gather.asp
字号:
<%
Dim RsTemp_v()
Redim RsTemp_v(ubound(RsTemp_name))
id=request.QueryString("id")
call admin_master(0,0)
call admin_cid_sid()
call admin_header(0,0)
%>
<tr><td align=center colspan=2 height=30>
<table border=0>
<tr>
<td><a href='admin_<% response.write index_url%>_module.asp'>模块列表</a></td>
<td width=10></td>
<td><a href='admin_<% response.write index_url%>_module.asp?action=add'<%if action="add" then response.write " class=red"%>>添加模块</a></td>
<td width=10></td>
<td><a href='admin_<% response.write index_url%>_module.asp?action=mInput'<%if action="mInput" then response.write " class=red"%>>导入模块</a></td>
<td width=10></td>
<td><a href='admin_<% response.write index_url%>_module.asp?action=mExport'<%if action="mExport" then response.write " class=red"%>>导出模块</a></td>
<td width=10></td>
<td><a href='admin_<% response.write index_url%>_gather.asp'>数据采集</a></td>
</tr>
</table>
</td></tr>
</table>
<%
if id<>"" and isnumeric(id) then
dim startime,FromUrl,ItemName,PicPath,PicValue,FalshPath,FalshValue,MusicPath,MusicValue,OtherPath,OtherValue,Articlelist1,Articlelist2,Addresslist1,Addresslist2,ManyPage,ManyFirst1,ManyFirst2,ManyNext1,ManyNext2,PicType,FalshType,MusicType,OtherType,Manys,Addresslist
startime=timer()
dim Pic_count,Pic_Err
dim Swf_count,Swf_Err
dim Mp3_count,Mp3_Err
dim Other_count,Other_err
dim webstr,web_str
dim Pages,save_count
Dim Tempurl,bs_counts
bs_counts=0
id=Isform(request.QueryString("id"),"数字","数据传递")
sql="select * from [DB_Item] where id="&id
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,1,1
if rs.eof then
Response.Write("<script language='JavaScript'>alert('数据传递出错!');history.go(-1);</script>")
response.End()
else
FromUrl=rs("FromUrl")
ItemName=rs("ItemName")
CID=rs("C_ID")
sID=rs("s_ID")
PicPath=rs("PicPath")
PicValue=rs("PicValue")
FalshPath=rs("FalshPath")
FalshValue=rs("FalshValue")
MusicPath=rs("MusicPath")
MusicValue=rs("MusicValue")
OtherPath=rs("OtherPath")
OtherValue=rs("OtherValue")
Articlelist1=rs("Articlelist1")
Articlelist2=rs("Articlelist2")
Addresslist1=rs("Addresslist1")
Addresslist2=rs("Addresslist2")
ManyPage=rs("ManyPage")
ManyFirst1=rs("ManyFirst1")
ManyFirst2=rs("ManyFirst2")
ManyNext1=rs("ManyNext1")
ManyNext2=rs("ManyNext2")
PicType=rs("PicType")
FalshType=rs("FalshType")
MusicType=rs("MusicType")
OtherType=rs("OtherType")
Manys=rs("Manys")
Addresslist=rs("Addresslist")
end if
rs.close
if chk() then
dim Date_Form1,Date_Form2,Count_Form,Page_Form1,Page_Form2,Show_Form,Html_form,div_Form,a_Form,span_Form,font_Form,class_Form,style_Form,img_Form,OBJECT_Form,IFRAME_Form,SCRIPT_Form,IFileName,Match_Form,Pic_Form,Swf_Form,Mp3_Form,Other_Form,FirstRecord_Form,FirstPage_Form
csid=trim(request.form("c_id"))
FromUrl=request.Form("FromUrl")
Date_Form1=request.Form("date1")
Date_Form2=request.Form("date2")
Count_Form=request.Form("Count")
Page_Form1=request.Form("page1")
Page_Form2=request.Form("page2")
Show_Form=request.Form("show")
Html_form=request.Form("Html")
div_Form=request.Form("c_div")
a_Form=request.Form("c_a")
span_Form=request.Form("c_span")
font_Form=request.Form("c_font")
class_Form=request.Form("c_class")
style_Form=request.Form("c_style")
img_Form=request.Form("c_img")
OBJECT_Form=request.Form("c_OBJECT")
IFRAME_Form=request.Form("c_IFRAME")
SCRIPT_Form=request.Form("c_SCRIPT")
IFileName=request.Form("FileName")
Match_Form=request.Form("Match")
if Match_Form=1 then
Match_Form=true
else
Match_Form=false
end if
Pic_Form=request.Form("picsave")
Swf_Form=request.Form("falshsave")
Mp3_Form=request.Form("midsave")
Other_Form=request.Form("othersave")
FirstRecord_Form=request.Form("FirstRecord")
FirstPage_Form=request.Form("FirstPage")
call testdome()
else
call savedome()
end if
else
call admin_table(1)
call joekoe_chk_main()
end if
sub testdome()
dim webstr,Page_count,Page_Url,RsMarkingA,RsMarkingB,bs_count,WebstrsTemp,DB_Rs
dim web_str,titlemsg
call admin_table(1)
titlemsg = "(采集条件:"
If IsNumeric(Count_Form) Then
titlemsg = titlemsg&" 限制采集<font color=""0000ff"">" & Count_Form & "</font>条信息"
End If
If Date_Form1 <> "" And Date_Form2 > "" Then
titlemsg = titlemsg&" 限制采集<font color=""0000ff"">" & FormatDateTime(Date_Form1, 1) & "<font color=""000000"">到</font>" & FormatDateTime(Date_Form2, 1) & "</font>的信息"
ElseIf Date_Form1 <> "" Then
titlemsg = titlemsg&" 限制采集<font color=""0000ff"">" & FormatDateTime(Date_Form1, 1) & "<font color=""000000"">到</font>" & FormatDateTime(Now(), 1) & "</font>的信息"
ElseIf Date_Form2 <> "" Then
titlemsg = titlemsg&" 限制采集到<font color=""0000ff"">" & FormatDateTime(Date_Form2, 1) & "</font>的信息"
End If
call admin_td("开始采集 "&titlemsg&")")
Response.Write ("<tr><td><hr>"):Response.Flush
sql="select * from [DB_Dome] where ItemID="&ID&" and Columnid=1"
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,1,2
if rs.eof then
rs.close
call admin_error("你还没有定义采集模块!")
exit sub
else
RsMarkingA=rs("MarkingA"):RsMarkingB=rs("MarkingB")
end if
rs.close
bs_count=0
Tempurl = FromUrl
webstr=Cls.BytesToBstr(Cls.getHTTPPage(Tempurl),"GB2312")
webstr=Cls.stripHTML(webstr,Articlelist1,Articlelist2)
webstr=Cls.Manhunt(webstr,Addresslist1,Addresslist2,true,true,false,true)
webstr=Split(webstr,"$url$")
WebstrsTemp=webstr
dim db_i
if FirstRecord_Form=1 then
for DB_i= 0 to ubound(WebstrsTemp)
webstr(ubound(WebstrsTemp)-DB_i)=WebstrsTemp(DB_i)
next
end if
dim RsTemp,RsMatch
dim TempWeb
Page_count=0
for Page_count=0 to ubound(webstr)
Page_Url=Cls.HttpUrls(Addresslist&webstr(Page_count),FromUrl)
web_str=Cls.BytesToBstr(Cls.getHTTPPage(Page_Url),"GB2312")
DB_Rs=Cls.SeparateHTML(web_str,RsMarkingA,RsMarkingB)
if DB_Rs<>false then
DB_Rs=left(DB_Rs,40)
sql="select * from "&data_name&" where "&mm_topic&"='"&replace(DB_Rs,"'","''")&"'"
Set RsTemp= Server.CreateObject("ADODB.Recordset")
RsTemp.open sql,conn,3,2
if Match_Form then
if RsTemp.eof then
RsMatch=true
else
RsMatch=false
end if
else
RsMatch=true
end if
if RsMatch then
RsTemp.AddNew
call RsTemp_mm()
for i=0 to ubound(RsTemp_name)
RsTemp(""&RsTemp_name(i)&"")=RsTemp_v(i)
next
dim ColumnCName,ColumnEName,MarkingA,MarkingB,Marking,ArticleText
dim ColumnV,ColumnD,ColumnID
bs_counts= bs_counts+1
sql="select * from [DB_Dome] where ItemID="&ID&" "
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,1,2
do while not rs.eof
ColumnID=rs("ColumnID")
ColumnCName=rs("ColumnCName")
ColumnEName=rs("ColumnEName")
MarkingA=trim(rs("MarkingA")&" ")
MarkingB=trim(rs("MarkingB")&" ")
Marking=trim(rs("Marking")&" ")
ColumnV=rs("ColumnV")
ColumnD=rs("ColumnD")
if ColumnID=1 then
response.Write("<strong><font color=""#FF0000"">No.")
response.Write(bs_counts)
response.Write(" </strong></font><br>")
end if
response.Write("<strong><font color=""#0000FF"">")
response.Write(ColumnCName&":</strong></font>")
if Marking<>"" then
TempWeb=Marking
else
if MarkingA<>"" and MarkingB<>"" then
TempWeb=Cls.SeparateHTML(web_str,MarkingA,MarkingB)
else
TempWeb=""
end if
end if
if ColumnV="longtext" then
response.Write(Cls.Cen(TempWeb)&"<br>")
else
response.Write(TempWeb&"<br>")
end if
select case ColumnV
case "int"
if TempWeb<>"" then
if not isnumeric(TempWeb) then
if ColumnD<>"" and isnumeric(ColumnD) then
TempWeb=ColumnD
else
TempWeb="0"
end if
end if
else
if ColumnD<>"" and isnumeric(ColumnD) then
TempWeb=ColumnD
else
TempWeb="0"
end if
end if
if int(TempWeb)>0 then
RsTemp(""&ColumnEName&"")=int(TempWeb)
else
if RsTemp(""&ColumnEName&"")>0 then
RsTemp(""&ColumnEName&"")=RsTemp(""&ColumnEName&"")
else
RsTemp(""&ColumnEName&"")=0
end if
end if
case "varchar"
if ColumnD<>"" and isnumeric(ColumnD) then
if int(ColumnD)>0 then TempWeb=left(TempWeb,int(ColumnD))
end if
if TempWeb<>"" and TempWeb<>"False" then
RsTemp(""&ColumnEName&"")=joekoe_cms.code_form(TempWeb)
end if
case "datetime"
if TempWeb<>"" then
if not IsDate(TempWeb) then
if ColumnD<>"" and IsDate(ColumnD) then
TempWeb=ColumnD
else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -