La salute in pillole

codice ASP







Codice asp per mostrare gli rss salute nel tuo sito

Vedi anche:
Box notizie per il tuo sito
Feed rss salute
Copia il codice che segue in una pagina ASP per mostrare le notizie di salute e benessere.
Puoi indicare la fonte: (www.lasaluteinpillole.it)

<%
rssURL = "http://feeds.feedburner.com/lasaluteinpillole/primapagina"
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<br>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 "<a href=""" & strURL & """>" &_
  Left(strTitle,280) & "</a></b><br>" & Left(strDesc,700) & "...<br>"
 END IF
 'azzero tutto per il prossimo passaggio
 strTitle = ""
 strURL = ""
 strDescription = ""

Next

set objNodeList = Nothing
End if
%>

<br> Fonte: <a href="https://www.lasaluteinpillole.it">www.lasaluteinpillole.it</a>
























































Contatti | Comunicati stampa salute | Termini e condizioni | ©2012 La salute in pillole - supplemento alla rivista www.studiocataldi.it