Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Leggere Rss e immagini

  1. #1
    Utente di HTML.it
    Registrato dal
    Jul 2001
    Messaggi
    80

    Leggere Rss e immagini

    Ciao ragazzi.
    Premetto che sto iniziando ora a studiarmi la gestione degli Rss, volevo chiedervi come vengono gestite le immagini. Per intenderci ho questo pagina :

    codice:
     <%
    
    'Rielaboraun documento XML RSS e RDF
    'e fornisce in output un documento HTML
    url=request("url")
    
    ' Creo oggetto DOM XML
    Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")
    objXML.async = false
    objXML.setProperty "ServerHTTPRequest", True
    
    ' validazione del documento XML
    objXML.validateOnParse = false 'true
    
    ' non conservare spazi
    objXML.preserveWhiteSpace = false
    blnLoaded = objXML.Load("http://www.frascatiscienza.it/feed/")
    
    If Not blnLoaded Then
      Response.write "Nessuna news da visualizzare"
    Else
      set objNodeList = objXML.getElementsByTagName("channel")
      
      For Each objNode In objNodeList
        For Each objNode2 In objNode.childNodes
          Select Case objNode2.nodeName
            Case "title"
              html = html + "<tr><td>"
              html = html + objNode2.firstChild.nodevalue
              html = html + "</td></tr>"
            Case "link"
              html = html + "<tr><td><a target=_blank href="&objNode2.firstChild.nodevalue & ">"
              html = html + objNode2.firstChild.nodevalue
              html = html + "</a></td></tr>"
            Case "description"
              html = html + "<tr><td>"
              html = html + objNode2.firstChild.nodevalue
              html = html + "</td></tr>"
    		 
            End Select
    
        Next
      Next
    
      html = html + "<tr><td><hr></td></tr>"
    
      Set objNodeList = objXML.getElementsByTagName("item")
      For Each objNode In objNodeList
        For Each objNode2 In objNode.childNodes
           response.write  objNode2.nodeName& "
    "
          Select Case objNode2.nodeName
            Case "title"
              strTitle = objNode2.firstChild.nodevalue
            Case "link"
              strURL = objNode2.firstChild.nodevalue
            Case "description"
              strDescription = objNode2.firstChild.nodevalue
    		
          End Select
        Next
        
        html = html + "<tr><td><li/><a target=_blank href=" + strURL + ">"
        html = html + strTitle + "</a>
    " + strDescription +"</td></tr>"
        strTitle = ""
        strURL = ""
        strDescription = ""
      Next
    
      html = "<table width=400>"+html+"</table>"
      set objNodeList = Nothing
    
    End if
    %>
    
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    </head>
    <body>
    
    <% Response.write (html) %>
    
    
    <table border="0" width="400" cellspacing="0" cellpadding="0">
    <form action="RSSview.asp" method="POST">
    
    <tr><td width="100%"><hr></td></tr>
    <tr><td width="100%">Inserire l'URL di un feed RSS o RDF</td></tr>
    <tr><td width="100%"><input type="text" size="60" name="url" /></td></tr>
    <tr><td width="100%"><input type="submit" value="Visualizza" /></td></tr>
    
    </form>
    </table>
    
    </body>
    </html>
    Riesco a leggere i testi e i link ma non le immagini.
    La mia necessità è , appunto riuscire a leggere anche le immagini.

    Potreste aiutarmi??
    Grazie

  2. #2
    Utente di HTML.it
    Registrato dal
    Jul 2001
    Messaggi
    80
    L'xml del feed è il seguente (.. ho tolto quasi tutti gli item per ragioni di spazio..)

    codice:
    <?xml version="1.0" encoding="utf-8"?>
    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
     <channel xmlns:cfi="http://www.microsoft.com/schemas/rss/core/2005/internal"
      cfi:lastdownloaderror="None">
      <title cf:type="text">Frascati Scienza</title>
      <atom:link href="http://www.frascatiscienza.it/feed/" rel="self" type="application/rss+xml"/>
      <link>http://www.frascatiscienza.it/</link>
      <description cf:type="text">Associazione Frascati Scienza</description>
      <lastBuildDate>Mon, 06 Dec 2010 09:28:28 GMT</lastBuildDate>
      <atom:updated>2010-12-06T09:28:28Z</atom:updated>
      <language>it</language>
      <sy:updatePeriod>hourly</sy:updatePeriod>
      <sy:updateFrequency>1</sy:updateFrequency>
      <generator>http://wordpress.org/?v=3.0.1</generator>
      <item>
       <title xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" cf:type="text">UNA MOSTRA TRA
        SCIENZA E ARTE PER SCOPRIRE LE ORIGINI DEL MONDO ( Frascati 11 dicembre- 6 gennaio)</title>
       <link>http://www.frascatiscienza.it/2010/1...bre-6-gennaio/</link>
       <comments>http://www.frascatiscienza.it/2010/1...naio/#comments</comments>
       <pubDate>Wed, 01 Dec 2010 13:08:16 GMT</pubDate>
       <atom:published xmlns:atom="http://www.w3.org/2005/Atom">2010-12-01T13:08:16Z</atom:published>
       <atom:updated xmlns:atom="http://www.w3.org/2005/Atom">2010-12-01T13:08:16Z</atom:updated>
       <author>giovanni.mazzitelli</author>
       <atom:author xmlns:atom="http://www.w3.org/2005/Atom">
        <atom:name>giovanni.mazzitelli</atom:name>
       </atom:author>
       <category>Rassegna Stampa</category>
       <category>biologia</category>
       <category>evidenza</category>
       <category>natura</category>
       <category>ricerca</category>
       <category>scienza</category>
       <guid isPermaLink="false">http://www.frascatiscienza.it/?p=6497</guid>
       <description xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" cf:type="html"
        >&lt;p&gt;&lt;a
        href="http://static.frascatiscienza.it/wp-content/uploads/2010/10/civita-news.png"&gt;&lt;img
        class="alignleft size-medium wp-image-6190" title="civita news"
        src="http://static.frascatiscienza.it/wp-content/uploads/2010/10/civita-news-300x80.png" alt=""
        width=300 height=80&gt;&lt;/a&gt;FRASCATI-Trovare_ l’origine del mondo, scoprire la
        natura della materia, le leggi che la regolano e ricercare gli anelli mancanti dell’evoluzione
        della specie umana. Sono le domande poste dalla scienza che hanno influenzato da sempre la
        creatività artistica e ispirano la mostra L’Origine: un viaggio tra scienza e arte, organizzata
        presso le Scuderie Aldobrandini a Frascati (piazza Guglielmo Marconi 6), dall’11 dicembre 2010
        al 6 gennaio 2011 dal Comune di Frascati, Frascati Scienza, INFN, CERN , Nairucu-Arts, il
        Dipartimento di Biologia Ambientale della Sapienza. &lt;a
        href="http://www.civitanews.it/2010/11/30/una-mostra-tra-scienza-e-arte-per-scoprire-le-origini-del-mondo-frascati-11-dicembre-6-gennaio/"&gt;(continua…)&lt;/a&gt;&lt;/p&gt; </description>
       <atom:summary xmlns:atom="http://www.w3.org/2005/Atom" type="html">FRASCATI-Trovare_ l’origine
        del mondo, scoprire la natura della materia, le leggi che la regolano e ricercare gli anelli
        mancanti dell’evoluzione della specie umana. Sono le domande poste dalla scienza che hanno
        influenzato da sempre la creatività artistica e ispirano la mostra L’Origine: un viaggio tra
        scienza e arte, organizzata presso le [...]</atom:summary>
       <wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/"
        >http://www.frascatiscienza.it/2010/1...-gennaio/feed/</wfw:commentRss>
       <slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments>
       <cfi:id>19</cfi:id>
       <cfi:effectiveId>890150800</cfi:effectiveId>
       <cfi:read>true</cfi:read>
       <cfi:downloadurl>http://www.frascatiscienza.it/feed/</cfi:downloadurl>
       <cfi:lastdownloadtime>2010-12-07T07:23:43.796Z</cfi:lastdownloadtime>
      </item>
     </channel>
    </rss>
    I link alle immagini sono nell descrizione dell'item. Ma lo script sopra non me le fa visualizzare sulla pagina html.
    Perchè???
    Qualcuno mi faccia vedere la luce in fondo al tunnel per favore!!

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.