here's a quick XML package to get a public Youtube feed (be aware of namespaces & default namespaces):
Code:<package displayname="YouTubeFeed" version="2.1" debug="false" includeentityhelper="false"> <webquery name="youtube" RetType="xml"> <url>http://gdata.youtube.com/feeds/api/users/{username}/uploads?orderby=updated&max-results={maxResults}</url> <querystringreplace replaceTag="{username}" replacetype="request" paramtype="runtime" replaceparamname="username" defvalue="molinafinejewelers" validationpattern=""/> <querystringreplace replaceTag="{maxResults}" replacetype="request" paramtype="runtime" replaceparamname="maxResults" defvalue="3" validationpattern="^\d{1,10}$"/> </webquery> <PackageTransform> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:yt="http://gdata.youtube.com/schemas/2007" exclude-result-prefixes="aspdnsf atom media openSearch gd yt"> <xsl:output method="html" omit-xml-declaration="yes" /> <xsl:template match="/"> <xsl:apply-templates select="/root/youtube/atom:feed/atom:entry" /> </xsl:template> <xsl:template match="atom:entry"> <div class="entry"> <a target="_blank" class="imagelink"> <xsl:attribute name="href" > <xsl:value-of select="media:group/media:player/@url" /> </xsl:attribute> <img alt="video" height="90" width="120" > <xsl:attribute name="src" > <xsl:value-of select="media:group/media:thumbnail[2]/@url" /> </xsl:attribute> </img> </a> <p> <a target="_blank" class="titlelink"> <xsl:attribute name="href" > <xsl:value-of select="media:group/media:player/@url" /> </xsl:attribute> <xsl:value-of select="aspdnsf:GetMLValue(atom:title)" /> </a> <br />by <a target="_blank" class="authorlink"> <xsl:attribute name="href" > <xsl:value-of select="concat('http://www.youtube.com/user/', atom:author/atom:name)" /> </xsl:attribute> <xsl:value-of select="aspdnsf:GetMLValue(atom:author/atom:name)" /> </a> <br />views <xsl:value-of select="yt:statistics/@viewCount" /> </p> </div> </xsl:template> </xsl:stylesheet> </PackageTransform> </package>



Reply With Quote
