Voici le code pour lire un flux RSS.
Seulement je cherche a faire apparaître 3 news aléatoirement !
Mais je ne sais pas comment m'y prendre.
Une idée ?
<html>
<head>
<title>RSS Reader</title>
</head>
<body>
<%
If DateDiff("h", Application("rss-html-time"), Now()) >= 2 then
Set xmlDOM = Server.CreateObject("MSXML2.DOMDocument")
xmlDOM.async = False
xmlDOM.setProperty "ServerHTTPRequest", True
xmlDOM.Load("http://www.codebeach.com/rss-it-j
obs.asp")
'Get all of the <item> tags in the feed
Set itemList = xmlDOM.getElementsByTagName("item")
strHTML = strHTML & "<ul>"
'Iterate over each item
For Each item In itemList
'Parse the item children
For each child in item.childNodes
Select case lcase(child.nodeName)
case "title"
title = child.text
case "link"
link = child.text
case "description"
description = child.text
End Select
Next
'Build the HTML for each bullet item
strHTML = strHTML & "<li>"
strHTML = strHTML & "<a href='" & Server.HTMLEncode(link) & "'>"
strHTML = strHTML & Server.HTMLEncode(title)
strHTML = strHTML & "</a>"
strHTML = strHTML & "<br>"
strHTML = strHTML & description
strHTML = strHTML & "<br> "
strHTML = strHTML & "</li>"
Next
strHTML = strHTML & "</ul>"
Set xmlDOM = Nothing
Set itemList = Nothing
Application.Lock
Application("rss-html") = strHTML
Application("rss-html-time") = Now()
Application.UnLock
End If
Response.Write(Application("rss-html"))
%></body>
</html>