用Asp+XmlHttp实现RssReader功能
来源:CSDN 时间:2008-07-09 12:20:00
<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"> 双击鼠标可以关闭摘要,只显示标题
</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
%>
标签:XmlHttp,rss,asp
0
投稿
猜你喜欢
asp图片加水印的功能代码
2011-02-05 11:02:00
如何测试字符串的长度?
2009-11-11 20:02:00
ASP中类的详细介绍(class Property Get、Property Let)
2008-02-20 19:18:00
css学习笔记:DIV水平垂直居中
2009-06-19 12:45:00
Oracle数据表分区的策略
2010-07-28 12:59:00
新手入门:防范SQL注入攻击的新办法
2009-03-11 15:14:00
使用ASP常见问题解答
2007-10-11 14:07:00
朋友去一家游戏公司的机试题,被难住了
2009-11-29 15:23:00
MySQL 查询缓存的实际应用代码示例
2010-06-11 12:04:00
交互设计模式(二)-Pagination(分页,标记页数)
2009-08-03 13:37:00
显示ASP页面源码的代码
2008-10-12 13:05:00
详解MySQL数据库中字符串的正确使用
2010-06-20 15:01:00
讲解数据库加密技术的功能特性与实现方法
2008-12-18 14:24:00
banner字体设计与应用
2009-07-06 14:42:00
多栏自适应布局问题浅谈
2010-08-16 12:56:00
ACCESS数据库转换MYSQL数据库的软件
2007-09-20 20:06:00
如何把小写数字转换成英文?
2009-11-06 13:59:00
QQ在线客服网页代码大全
2008-01-17 18:28:00
说说tab设计
2009-07-26 09:56:00
在SQL Server2000中恢复Master数据库
2008-01-05 14:05:00