<%
rssURL = "http://news.studiocataldi.it/rss.asp"
Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")
objXML.async = false
objXML.setProperty "ServerHTTPRequest", True
objXML.validateOnParse =false
objXML.preserveWhiteSpace = false
rssFile = objXML.Load(rssURL)
'Se ci sono errori stampo a video
If Not rssFile Then
Response.write "Non ci sono notizie
per favore avvisate il webmaster"
'Se NON ci sono errori proseguo...
Else
limite_max=15
limite_min=1
conta=0
'Recupero i dati dai nodi Item (e sotto nodi)
Set objNodeList = objXML.getElementsByTagName("item")
For Each objNode In objNodeList
'stampo a video...
conta=conta+1
IF conta>=limite_min AND conta<=limite_max THEN
For Each objNode2 In objNode.childNodes
Select Case objNode2.nodeName
Case "title"
strTitle = objNode2.firstChild.nodevalue
Case "link"
strURL = objNode2.firstChild.nodevalue
Case "description"
strDesc = objNode2.firstChild.nodevalue
End Select
Next
Response.write "
" &_
Left(strTitle,80) & "" & Left(strDesc,300) & "...
"
END IF
'azzero tutto per il prossimo passaggio
strTitle = ""
strURL = ""
strDescription = ""
Next
set objNodeList = Nothing
End if
%>
Fonte:
www.studiocataldi.it