26
Feb/092
Feb/092
Listar favoritos do YouTube
A Classe:
<%
class YouTube
private objXML
private objLista
private usuario
private url
private id, i
private nome_objeto
private sub objetosXML()
set objXML = server.createObject("MSXML2.DOMDocument.3.0")
objXML.async = false
objXML.setProperty "ServerHTTPRequest", true
objXML.validateOnParse = false
objXML.load(url)
set objLista = objXML.getElementsByTagName("*")
end sub
public sub carregarURL()
usuario = "nome_do_seu_usuario"
url = "http://gdata.youtube.com/feeds/api/users/"&usuario&"/favorites"
call objetosXML()
for i = 16 to (objLista.length - 1)
select case (objLista.item(i).nodeName)
case "id"
nome_objeto = objLista.item(i).text
id = right(nome_objeto, len(nome_objeto) - instrRev(nome_objeto,"/"))
tabela = tabela & "<table width=""494"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
tabela = tabela & "<tr><td colspan=""2"">"
tabela = tabela & "<object width=225 height=144><param name=movie value=http://www.youtube.com/v/"&id&"></param>"
tabela = tabela & "<param name=allowFullScreen value=true></param>"
tabela = tabela & "<param name=allowscriptaccess value=always></param>"
tabela = tabela & "<embed src=http://www.youtube.com/v/"&id&" type=application/x-shockwave-flash allowscriptaccess=always allowfullscreen=true width=225 height=144></embed>"
tabela = tabela & "</object>"
tabela = tabela & "</td></tr>"
case "title"
tabela = tabela & "<tr><td width=""92"" valign=""top"" style=""font: 11px Arial;""><strong>TÍTULO:</strong></td>"
tabela = tabela & "<td width=""402"" valign=""top"" style=""font: 11px Arial;"">"&objLista.item(i).text&"</td></tr>"
case "content"
tabela = tabela & "<tr><td valign=""top"" style=""text-align: justify; font: 11px Arial;""><strong>DESCRIÇÃO:</strong></td>"
tabela = tabela & "<td valign=""top"" style=""font: 11px Arial;"">"&objLista.item(i).text&"</td></tr>"
tabela = tabela & "</table><br><br>"
end select
next
response.write(tabela)
end sub
end class
%>
O HTML
<%@ Language="VBScript" %> <!--#include file="Default.class.asp"--> <% dim yt set yt = new YouTube %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <%=yt.carregarURL()%> </body> </html>
O Resultado:

Tagged as: api, ASP, favoritos, listar videos, MSXML2.DOMDocument.3.0, tube, video, videos, you, youtube
Página 1 de 11

Categorias
- ActionScript 2.0/3.0
- ASP
- ASP.NET - Tutoriais
- CGI / Perl
- ColdFusion
- CSS
- Em Geral
- HTML
- JAVA
- JavaScript / Ajax / DHTML
- JSON
- JSP
- Perguntas dos Usuários
- PHP
- Plataforma.NET
- Programas
- Servidor IIS
- SQL
- Tecnologia
- XML / XSL
Os Melhores da WEB
(i) ... load ajax api ASP ASP.NET class classe Combo ComboBox count CSS data datas date div dom efeitos fade fadeout For formulario Function HTML int JAVA java script javascript jquery length nodeName noticia Object PHP public Randomize replace rnd Select tedk Ted k' url VB webly xml
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.
Delicious
- Scripts em Jquery
- CSS3.com: CSS reference guide, and blog
- Aprendendo CSS Mastering CSS Coding: Getting Started
- Tutorial em Portugues de Objective-C
- iPhone SDK Examples and Tutorials - About Objects
- jQuery Plugins - Plugins, Extensions & Tutorials for jQuery JavaScript ...
- Jquery Codigos
- Convert Data, Files Online FREE: PDF, Word, Excel, Text, Images
- Customizar Formulários
- Compressor de CSS
