ASP源码
PHP源码
.NET源码
JSP源码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
http://ww***.org/TR/html4/loose.dtd
'取行字符串在另一字符串中的出现位置
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
'替换字符串函数
function ReplaceStr(ori,str1,str2)
ReplaceStr=replace(ori,str1,str2)
end function
'====================================================
function ReadXml(url,code,start,ends)
set oSend=createobject("Mi***soft.XMLHTTP")
SourceCode = oS***.open ("GET",url,false)
oS***.send()
ReadXml=BytesToBstr(oS***.responseBody,code )
start=Instr(ReadXml,start)
ReadXml=mid(ReadXml,start)
ends=Instr(ReadXml,ends)
ReadXml=left(ReadXml,ends-1)
end function
function SubStr(body,start,ends)
start=Instr(body,start)
SubStr=mid(body,start+len(start)+1)
ends=Instr(SubStr,ends)
SubStr=left(SubStr,ends-1)
end function
dim getcont,NewsContent
dim url,title
url="http://www.***.com"'新闻网址kn***ky.com
getcont=ReadXml(url,"gb2312","
"," ") NewsContent=RemoveHtml(NewsContent) NewsContent=replace(NewsContent,VbCrLf,"") NewsContent=replace(NewsContent,vbNewLine,"") NewsContent=replace(NewsContent," ","") NewsContent=replace(NewsContent," ","") NewsContent=replace(NewsContent," ","") NewsContent=replace(NewsContent,"n","") NewsContent=replace(NewsContent,chr(10),"") NewsContent=replace(NewsContent,chr(13),"") '===============get Content======================= re***nse.Write(NewsContent) KeyId=SubStr(NewsContent,"列号:","信息类别:") NewsClass=SubStr(NewsContent,"类别:","所在城市:") City=SubStr(NewsContent,"城市:","房屋具体位置:") Position=SubStr(NewsContent,"位置:","房屋类型:") HouseType=SubStr(NewsContent,"类型:","楼层:") Level=SubStr(NewsContent,"楼层:","使用面积:") Area=SubStr(NewsContent,"面积:","房价:") Price=SubStr(NewsContent,"房价:","其他说明:") Demostra=SubStr(NewsContent,"说明:","联系人:") ContactMan=SubStr(NewsContent,"联系人:","联系方式:") Contact=SubStr(NewsContent,"联系方式:","信息来源:") re***nse.Write("总序列号:"&KeyId&" ") re***nse.Write("信息类别:"&NewsClass&" ") re***nse.Write("所在城市:"&City&" ") re***nse.Write("房屋具体位置:"&Position&" ") re***nse.Write("房屋类型:"&HouseType&" ") re***nse.Write("楼层:"&Level&" ") re***nse.Write("使用面积:"&Area&" ") re***nse.Write("房价:"&Price&" ") re***nse.Write("其他说明:"&Demostra&" ") re***nse.Write("联系人:"&ContactMan&" ") re***nse.Write("联系方式:"&Contact&" ") 'title=RemoveHTML(aa(i)) 're***nse.Write("title:"&title) for n=0 to ap***cation.Contents.count if(ap***cation.Contents(n)=KeyId) then ifexit=true end if next if not ifexit then application(time&i)=KeyId '添加到数据库 '==================================================== set rs***rver.CreateObject("ad***.recordset") rs.open "select top 1 * from news order by id desc",conn,3,3 rs***dnew rs("NewsClass")=NewsClass rs("City")=City rs("Position")=Position rs("HouseType")=HouseType rs("Level")=Level rs("Area")=Area rs("Price")=Price rs("Demostra")=Demostra rs("ContactMan")=ContactMan rs("Contact")=Contact rs***date rs.close set rs=nothing end if '================================================== next function RemoveTag(body) Set regEx = New RegExp | ","") TempStr=replace(TempStr," | ","")
总序列号: |
479280 |
信息类别: |
出租 |
所在城市: |
济南 |
房屋具体位置: |
华龙路华信路交界口 |
房屋类型: |
其他 |
楼层: |
六层 |
使用面积: |
24~240 平方米之间 |
房价: |
0 [租赁:元/月,买卖:万元/套] |
其他说明: |
华信商务楼3至6层小空间对外出租(0.5元/平起),本楼属纯商务办公投资使用,可用于办公写字间,周边设施齐全、交通便利(37、80、K95在本楼前经过),全产权、市证,楼内设施包括水、电、暖、电梯设施齐全,有意者可电讯! |
联系人: |
鲁、王 |
联系方式: |
88017966、86812217 |
信息来源: |
2005-8-4 8:28:55 来自:218.98.86.175 |
点击次数: |
19 |