tags:

views:

2652

answers:

6

Hello,

Is there a way to send only an Image with a link and some alt text for each item in an rss feed?

I looked at the enclosure tag but this is only for video's and music.

+2  A: 

Flickr for example does this with

<link rel="enclosure" type="image/jpeg" href="image_url_here" />

inside <entry> elements.

Koraktor
A: 

I have now something within the description but for some reason all my

<p> -tags

are striped, they look like

p

without the brackets.

I use the strip_tags function in php but the <p> is in the list of allowable tags

sanders
A: 

This is possible in RRS2,

see http://cyber.law.harvard.edu/rss/rss.html#ltenclosuregtSubelementOfLtitemgt

So you have to use the enclosure tag, to add media

Regards, Barry de Graaff

Barry de Graaff
A: 

Regarding the <p> tag issue, You need to encode html within the xml.

Your code would look something like this:

<description>&lt;p&gt; Text in the tag &lt;/p&gt;</description>
Tiggerito
A: 

You should use the enclosure tag within item to include the image. You can use it for images by setting the correct Mime Type (for example: image/jpeg) and including the image size as the "length" attribute. The length attribute doesn't need to be completely accurate but it's required for the RSS to be considered valid.

Here's a helpful article that discusses this and other options.

Shez
A: 

The enclosure element can be used to transmit pictures. The RSS 2.0 spec is quite clear about that, saying that the type is a MIME type. It does not say it is restricted to audio or video.

I use it that way for a very useful set of photo feeds from Agence France Presse.

Here's an example, the main feed.

http://static.newsriver.org/afp/rss.xml

Dave

Dave Winer