• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

atom2rss.asp

asp 搞代码 4年前 (2022-01-03) 41次浏览 已收录 0个评论
代码如下:
<%
‘ atom2rss.asp
‘ Author: Francesco Passantino
‘ Email: [email protected]
‘ Blog: www.iteam5.net/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 “

ERROR
code: ” & _
objXML.parseError.errorCode & _

Linea/Col: ” & _
objXML.parseError.line & “/” & _
objXML.parseError.linepos & “

Else

rsstitle=”iteam5.net/blog”
rssdescription=”Blog sulle novit?del settore Information & Communication Technologies”
rsslink=”http://www.iteam5.net/blog&#8221;
rsslanguage=”it”

xml= ““&server.htmlencode(rsstitl<em style="color:transparent">来源gao.dai.ma.com搞@代*码网</em>e)&”“&server.htmlencode(rssdescription)&””&server.htmlencode(rsslink)&””&server.htmlencode(rsslanguage)&””

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=”                 objNode4.GetAttribute(“href”)&”‘>”& _
                linkable&””
                StrDescription = replace(StrDescription,linkable,htmlink)
            end select
            next
        end select
    next
    End Select
Next

xml= xml & “”
xml=xml & “
xml=xml & “”
xml=xml & “”

strTitle = “”
strURL = “”
strDescription = “”

Next

xml = xml & “”
response.ContentType = “text/xml”
response.write xml

set objNodeList = Nothing

End if
End sub

call atom2rss(“http://www.iteam5.net/blog/feed.xml&#8221;)

%>

以上就是atom2rss.asp的详细内容,更多请关注gaodaima搞代码网其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:atom2rss.asp

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址