tags:

views:

162

answers:

3

hi all,

I need to make thumbnails available in RSS, i.e. show pictures in RSS. I started to use Yahoo' Media RSS module. Good documentation, good examples. Ok.

Here is my snippet of RSS' xml and__ it doesn't show pictures:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"&gt;
    <channel>
        <link>http://localhost:8080/dir/jrOreAeH/Pictures.html&lt;/link&gt;
        <item>
            <title>Winter.jpg</title>
            <link>http://localhost:8080/photo/iZ0Omnkt/Winter.html&lt;/link&gt;
            <media:content fileSize="105542" height="100"
                url="http://localhost:8080/img/37/f5b44ca3/Winter.jpg?sizeM=2" width="100"/>
            <pubDate>25/10/2010</pubDate>
        </item>
        <item>
            <title>Edge.jpg</title>
            <link>http://localhost:8080/photo/yfLmrjtu/Edge.html&lt;/link&gt;
            <media:content fileSize="28521" height="100"
                url="http://localhost:8080/img/38/650b5132/Edge.jpg?sizeM=2" width="100"/>
            <pubDate>25/10/2010</pubDate>
        </item>
    </channel>
</rss>

I believe xml is correct and images should be displayed, but in fact - is not. So, what's wrong?!

A: 

i have the same problem, parsing is working (shows up in the console) but the images dont show up in the table... Anyone?

A: 

I have use this one working properly:

Shamshad Khan
A: 

Try nesting the element inside the ..

Then if you are viewing the rss in a browser, the media elements sometimes do not show by default, view the source to see if your media elements are there.

You might have to use a php or asp script to turn the Rss into an XMLDocumnet object then in php you can echo your html and feed variables.. for asp I had to call in a an XSL stylesheet to display the elements how you want..

ASP script to turn rss into dom doc..

<% Sub getXML(sourceFile) dim styleFile, source, style

'Establish the XSLT stylesheet
styleFile = Server.MapPath("PATH TO THE XSL STYLESHEET")

set source = Server.CreateObject("Msxml2.DomDocument")
source.async = false
source.setProperty "ServerHTTPRequest", true
source.load CStr(sourceFile)

set style = Server.CreateObject("Msxml2.DomDocument")
style.async = false
style.load styleFile

Response.write source.transformNode(style)
set source = nothing
set style = nothing

End Sub %>

<% getXML("URL of THE FEED") %>

XSL Stylesheet sample..

    <xsl:variable name="title" select="title" />
    <xsl:variable name="description" select="description" />
    <xsl:variable name="thumb" select="media:content/media:thumbnail/@url" />

    <p class="bold"><a style="text-decoration: none"><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute><xsl:value-of select="$title" disable-output-escaping="yes"/></a></p>
    <p><xsl:value-of select="$description" disable-output-escaping="yes"/></p>
    <img src="{$thumb}" alt="{$title}"/>
</xsl:if>

Alex
for php 5+ there is a free script that turns rss into object.. google RSS_PHP.php
Alex