当前位置: 首页 > 图文教程 > 网络编程 > ASP > 用Asp+XmlHttp实现RssReader功能

ASP
ASP动态生成的javascript表单验证代码
将身份证从15位升级为18位的函数
ASP自定义函数,仿VBA中域函数DLookup
6行代码实现无组件上传
用VS2003调试ASP的方法和体会
ASP中存储过程调用的两种方式及比较
升级到2003后访问数据库发生8007007f错误的解决
ACCESS转化成SQL2000需要注意的几个问题
让ASP程序运行于非Windows平台
一些不长见的ASP调用存储过程的技巧
网站图片扫描类
一条sql 语句搞定数据库分页
在ASP中取得服务器网卡的MAC地址、DNS地址等网络信息
ASP中轻松实现变量名-值变换
用Xml2OleDb将XML文件插入到数据库
购物车中数据的存放方式
ASP数据库编程SQL常用技巧
在ASP中利用ADO显示Excel文件内容的函数
ASP+SQL Server之图象数据处理
在 Access 中使用“存储过程”

ASP 中的 用Asp+XmlHttp实现RssReader功能


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 88 ::
收藏到网摘: n/a

 

<style>
body {margin:10px;background-color:#ffffff;margin-top:6px;}
form{margin:0px;}
* {font:12px tahoma;line-height:140%;color:#000000}
.title {font-weight:bold;color:red;}
.time {font:10px;color:#999999;}
a {text-decoration:none;color:blue;}
</style>
<script type="text/javascript">
var switcher=0;
</script>
<body ondblclick="if(switcher==0){document.styleSheets[0].addRule('div','display:none');switcher=1}else{document.styleSheets[0].addRule('div','display:block');switcher=0}">
<form name="rssform" method=post action="">
RSS资源:<INPUT TYPE="text" NAME="RssFeed" size=60 style="height:22px" value="<%=request("RssFeed")%>" onfocus=select()> <input type="submit" value="Read It"> &nbsp;&nbsp;双击鼠标可以关闭摘要,只显示标题
</form>
<hr/>
<%
If(request("RssFeed")="") Then
url="/rss2.asp"
else
url=request("RssFeed")
End If

Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", url, False
xml.Send

Set xmlDom = server.createObject("microsoft.xmldom")
xmlDom.async=False
xmlDom.ValidateOnParse=false
xmlDom.load(xml.responseXML)

if xmlDom.ReadyState>2 Then 

  set oItem=xmlDom.getElementsByTagName("item")

  for i=0 to oItem.length-1
    response.write "<span style='font:bold 9px verdana;color:#000000'>"&i+1&"</span>. <a class='title' href='"&oItem(i).childNodes(1).text&"' target='_blank'>"&oItem(i).childNodes(0).text&"</a> <span class='time'>["&oItem(i).childNodes(3).text&"]<br />"
    response.write "<div>摘要:"&oItem(i).childNodes(4).text&"</div><br>"
  next
end if
%>