Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    pagina asp e canale youtube

    Ciao a tutti,
    devo fare una pagina asp che si interfacci automaticamente ad un canale youtube.
    in giro ho trovato questo script che funziona perfettamente per un singolo video:

    codice:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title></title>
    </head>
    <body>
    <%
    
    qui_metto_il_mio_video_id = "I_mwcfUAO4M"
    
    call F_GetYouTubeVideoData(qui_metto_il_mio_video_id)
    
    Function F_GetYouTubeVideoData(v)	
    	'==== Verifico che l'ID video cntenga almeno 3 caratteri
    	if len(v) < 3 then
    		response.write "ID video non corretto..."
    		exit function
    	end if
    	
    	'==== Inizializzo il Parser MS XML...
    	Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")
    	objXML.async = false
    	objXML.setProperty "ServerHTTPRequest", True
    	
    	
    	'==== Carico i dati XML VIDEO
    	strFile = "http://gdata.youtube.com/feeds/api/videos/" & v
    	objXML.Load (strFile)
    
    	Set AllItems = objXML.selectNodes("//entry")
    	
    	For I = 0 to (AllItems.Length - 1)
          '= Vado nei media:group
    	  Set GetYouTubeData = AllItems(I).selectNodes("media:group")
    	  For J = 0 to (GetYouTubeData.Length-1)
    	
    		'==== Thumbnails VIDEO
    		Set varThumbnails = GetYouTubeData(J).selectNodes("media:thumbnail")
    		Response.Write("[img][/img]
    " & vbcrlf)
    		Set varThumbnails = nothing
    		
    		'==== TITOLO VIDEO
    		Set Title = GetYouTubeData(J).selectNodes("media:title")
    		Response.Write(Title(0).text & "
    " & vbcrlf)
    		Set Title = nothing
    		
    		'==== DESCRIZIONE VIDEO
    		Set varDescription = GetYouTubeData(J).selectNodes("media:description")
    		Response.Write(varDescription(0).text & "
    " & vbcrlf)
    		Set varDescription = nothing
    	
    	  Next
    	  Set GetYouTubeData = Nothing 
    	Next
    end function
    %>
    </body>
    </html>
    Come fare per fare un ciclo su tutti i video di un determinato canale?
    Grazie per le risposte...
    Chi Non RisiKa noN RosiKa

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Lo script scorre i nodi del nodo principale "media:group"
    Dovresti indagare come è fatto veramente...

    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.