<!--#include file="../iNCchuanqi/Config.asp"-->
<!--#include file="../iNCchuanqi/conn.asp"-->

<html>
<head>
<title>私服信息自定义采集</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="admin_style.css">
<style type="text/css">
<!--
.STYLE4 {color: #000000}
-->
</style>
</head>
<BODY  bgcolor="#46A3FF" leftMargin=0 topMargin=0>
<%if request.QueryString("action")="" then%>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<form method="POST" action="?action=caiji" name="form">
<tr> 
<th>CaiSF.Com发布网专用采集插件【<a href="http://Www.CaiSF.COM" target="_blank">Www.CaiSF.COM</a>】</th>
</tr>
<tr>
<td class=tablerow1><p><b>私服自定义采集步骤:</b><br>
  1、请点击下面的<span class="style1">点击获取采集页面</span>,将跳出一个对话框。<br>
  2、将对话框中的地址<span class="style1">完整的复制</span>到下面的文本框中。<br>
  3、点击<span class="style1">确定采集私服<span class="STYLE4">就开始采集了</span></span>。<br>
  4、一般采集更新在23:00-9:00。感谢大家支持<a target="_blank" href="http://Www.CaiSF.COM"><font color="#FF0000" size="4">CaiSF.Com发布网【Www.CaiSF.COM】</font></a>！QQ:53660542</p>
  <p><span class="TableRow1">
    请输入采集的页面：
<SELECT id=select6 size=1 name=cjyem>
            <OPTION value="" selected>请选择</OPTION>
            <OPTION value=http://www.CaiSF.com/cj.asp>CaiSF.com</OPTION>
	    <OPTION value=http://www.17ysf.com/cj.asp>17ysf.com</OPTION>
</a></select><font color="#FF0000">点击获取采集页面</font></p>
  <p><font color="#FF0000">
采集系统于系统同步，可以随时采集不受时间限制！如果采集失效，请联系QQ:53660542，我们将提供免费的采集插件！或者登陆<a href="http://Www.CaiSF.COM">Www.CaiSF.COM</a> 下载！</font></td>
</tr>
<tr>
<td class="TableRow1"><input type="submit" value="确定采集私服"></td>
</tr>
</form>
</table>
</TD>
</TR></TBODY></TABLE>

<%end if
if request.QueryString("action")="caiji" then
set rs = server.createobject("adodb.recordset")
dim Trs,sql,i,Texts,aaa
aaa=request.form("cjyem")
if aaa=""  then
		response.write "<script>alert('采集页面不能为空，请重新填写，请按照步骤执行');history.back()</script>"
		response.end
	end if
Function GetHttpPage(HttpUrl)
   If IsNull(HttpUrl)=True Or HttpUrl="$False$" Then
      GetHttpPage="$False$"
      Exit Function
   End If
   Dim Http
   Set Http=server.createobject("MSXML2.XMLHTTP")
   Http.open "GET",HttpUrl,False
   Http.Send()
   If Http.Readystate<>4 then
      Set Http=Nothing 
      GetHttpPage="$False$"
      Exit function
   End if
   GetHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
   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


Texts=GetHttpPage(aaa)
dim T1,T2,t3 : t3=0
if instr(Texts,"<body>")>0 then
Texts=mid(Texts,instr(Texts,"<body>"))
Texts=mid(Texts,1,instrrev("</body>"))
end if
t1=split(texts,"<br>")
t3=ubound(t1)
for i=0 to ubound(t1)-1
 t2=split(t1(i),"{}")
  if ubound(t2)=23 then 
  '写入数据库
  sql="select * from Gq_sfdata where ip='" & t2(2) & "'"
  Set Trs = Server.CreateObject("ADODB.recordset")
  trs.CacheSize=20
  trs.open sql,conn,1,3
  if trs.eof then
   trs.addnew
   for i1=1 to 21 : if not isnull(t2(i1)) then trs(i1)=t2(i1) :end if : next
   trs(22)=3
   trs("hits")=0
   trs.update
   response.Write t2(1) & " <font color=red >" & t2(5) &"</font> 添加成功<br>"
  else
   response.Write t2(1) & " <font color=red >" & t2(5) &"</font> 已存在<br>"
  end if
  'trs.close
  end if
next
Erase t1
Erase t2
set trs=nothing
conn.close
set conn=nothing
response.Write "共采集了" & t3 & "条信息 ，感谢您使用CaiSF.Com（Www.CaiSF.COM)采集系统"
end if
%>
<table width=98% align="center" border="0" cellspacing="0" cellpadding="0">
<tr align="middle">
<td height="30" valign="bottom">Copyright (c) 2010-2011 <a target="_blank" href="http://Www.CaiSF.COM"><b><font color="#708796">
Www.CaiSF.COM</font></b></a> All Rights Reserved .</td>
</tr>
<tr align="middle">
<td>Powered by：CaiSF.Com（Www.CaiSF.COM)<a target="_blank" href="http://Www.CaiSF.COM/"><b><font color="#708796">传奇发布站</font><font color="#cc0000">私服发布</font></b></font>  自定义采集板块</a></td>
</tr>
</table>
</body>
</html>