用Asp+XmlHttp实现RssReader功能

演示:http://goaler.xicp.net/RssReader.asp

<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 οndblclick="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")%>" οnfοcus=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
%>


转自: http://goaler.xicp.net/ShowLog.asp?ID=513
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值