atom2rss.asp
网络编程 2021-07-05 10:58www.168986.cn编程入门
代码如下:
<%
' atom2rss.asp
' Author: Francesco Passantino
' Email: francesco@iteam5.
' Blog: .iteam5./blog
' Start date: 17 Sep 2004
Sub atom2rss(URL)
Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")
objXML.async = false
objXML.setProperty "ServerHTTPRequest", True
objXML.validateOnParse = true
objXML.preserveWhiteSpace = false
If Not objXML.Load(URL) Then
Response.write "<P>ERROR<br>code: " & _
objXML.parseError.errorCode & _
"<br>Linea/Col: " & _
objXML.parseError.line & "/" & _
objXML.parseError.linepos & "</P>"
Else
rsstitle="iteam5./blog"
rssdescription="Blog sulle novit?del settore Information & Communication Technologies"
rsslink="http://.iteam5./blog"
rsslanguage="it"
xml= "<?xml version=""1.0"" encoding=""UTF-8""?><rss version=""0.91""><channel><title>"&server.htmlencode(rsstitle)&"</title><description>"&server.htmlencode(rssdescription)&"</description><link>"&server.htmlencode(rsslink)&"</link><language>"&server.htmlencode(rsslanguage)&"</language>"
Set objNodeList = objXML.getElementsByTagName("entry")
For Each objNode In objNodeList
For Each objNode2 In objNode.childNodes
Select Case objNode2.nodeName
Case "issued"
strdate= left(objNode2.firstChild.nodevalue,10)
Case "link"
strURL = objNode2.GetAttribute("href")
Case "title"
strTitle = objNode2.firstChild.nodevalue
'instead of Case "content"
Case "summary"
strDescription = objNode2.firstChild.data
For Each objNode3 In objNode2.childNodes
Select Case objNode3.nodeName
Case "div"
StrDescription = objNode3.text
For Each objNode4 In objNode3.childNodes
Select Case objNode4.nodeName
Case "a"
linkable=objNode4.firstChild.text
htmlink=" <a href='"& _
objNode4.GetAttribute("href")&"'>"& _
linkable&"</a>"
StrDescription = replace(StrDescription,linkable,htmlink)
end select
next
end select
next
End Select
Next
xml= xml & "<item>"
xml=xml & "<title><![CDATA[" & server.htmlencode(strTitle) & "]]></title>"
xml=xml & "<description><![CDATA[" & server.htmlencode(strDescription) & "]]></description>"
xml=xml & "<link><![CDATA[" & server.htmlencode(strURL) & "]]></link></item>"
strTitle = ""
strURL = ""
strDescription = ""
Next
xml = xml & "</channel></rss>"
response.ContentType = "text/xml"
response.write xml
set objNodeList = Nothing
End if
End sub
call atom2rss("http://.iteam5./blog/feed.xml")
%>
上一篇:atom_js.asp
下一篇:安全脚本程序的编写 V1.0第1/3页
编程语言
- 如何快速学会编程 如何快速学会ug编程
- 免费学编程的app 推荐12个免费学编程的好网站
- 电脑怎么编程:电脑怎么编程网咯游戏菜单图标
- 如何写代码新手教学 如何写代码新手教学手机
- 基础编程入门教程视频 基础编程入门教程视频华
- 编程演示:编程演示浦丰投针过程
- 乐高编程加盟 乐高积木编程加盟
- 跟我学plc编程 plc编程自学入门视频教程
- ug编程成航林总 ug编程实战视频
- 孩子学编程的好处和坏处
- 初学者学编程该从哪里开始 新手学编程从哪里入
- 慢走丝编程 慢走丝编程难学吗
- 国内十强少儿编程机构 中国少儿编程机构十强有
- 成人计算机速成培训班 成人计算机速成培训班办
- 孩子学编程网上课程哪家好 儿童学编程比较好的
- 代码编程教学入门软件 代码编程教程