Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 11

Discussione: Rss

  1. #1

    Rss

    dovrei inserire un rss feed xml di un sito esterno al mio...
    c'è un modo semplice con asp?
    o in alternativa, c'è il modo di importare un file xml da un indirizzo html esterno per poi elaborarlo?

    grazie
    Pamy

  2. #2

  3. #3
    GRAZIE ROBY
    AVEVO TROVATO GIA' QUEL CODICE
    MA NON FUNZIONA
    mi da questo errore:

    Errore
    : -2147012889
    Linea: 0/Colonna: 0


  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Lo devi personalizzare in base all'XML che devi elaborare.

    Roby

  5. #5
    ma non ho cambiato il file esterno, ho lasciato:
    http://www.webmasterpoint.org/rss/news.xml

    non dovrebbe funzionare già così?

    la personalizzazione consiste solo nel cambiare l'indirizzo html?

  6. #6
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Prova ad usare un altro componente, non ricordo quale sia quello giusto:
    Set objXML = Server.CreateObject("Microsoft.XMLDOM")

    Roby

  7. #7
    da sempre lo stesso errore roby

  8. #8
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
                <%
                'Inizializziamo il Parser MS XML
                Set objXML = Server.CreateObject("Microsoft.XMLDOM")
                objXML.setProperty "ServerHTTPRequest", true 
                objXML.async = False
    
                'Carica il file XML o il feed rss in formato xml
                strFile= "http://www.corrieredellosport.it/rss/Serie-A-5.xml"
    
                objXML.Load (strFile)
                istatus = objXML.parseerror
                if isNumeric(istatus) then istatus = cLng(istatus)
                if iStatus = 0 then
                    response.Write ("<dl>")
                    Set AllItems = objXML.selectNodes("//channel")
                    For I = 0 to (AllItems.Length - 1)
                        Set Post = AllItems(I).selectNodes("item")
                        For J = 0 to (Post.Length-1)
                            Set title = Post(J).selectNodes("title")
                            Set description = Post(J).selectNodes("description")
                            Set link = Post(J).selectNodes("link")
                            Set pubDate = Post(J).selectNodes("pubDate")
                            
                            rss_pubDate = pubDate(0).text
                            rss_pubdata = mid(rss_pubDate,6,11)
                            'rss_pubdata = FormatDateTime(rss_pubdata,1)
                            rss_pubdata = Ucase(left(rss_pubdata,1)) & mid(rss_pubdata,2,len(rss_pubdata)-1)
                            rss_pubdata = server.HTMLEncode(rss_pubdata)
                            rss_pubora = mid(rss_pubDate,18,5)
                            rss_title = title(0).text
                            rss_desc = description(0).text
                            if rss_desc &"[]" <> "[]" then server.HTMLEncode(rss_desc) else rss_desc = ""%>
                            <dt>›<%=rss_pubdata%><%=rss_pubora%></dt>
                            <dd><%=rss_title%>
    <%=rss_desc%></dd>
                        <%Next
                        Set title = Nothing
                        Set description = Nothing
                        Set link = Nothing
                        Set Post = Nothing
                    Next
                    response.Write ("</dl>")
                else
                    response.Write("
    
    Notizie momentaneamente non disponibili.</p>")
                end if%>
    Roby

  9. #9
    scusa se ti stresso
    ho provato anche il codice che mi hai dato ma mi dice:
    Notizie momentaneamente non disponibili.

    nonostante le notizie del corriere ci siano!!!


  10. #10
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Si ci sono.
    A me funziona, dovresti indagare sui valori di istatus.

    Roby

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.