This project has moved. For the latest updates, please go here.

Retrieving Images

Topics: Developer Forum, User Forum
Sep 22, 2008 at 3:34 PM
Hi, is there any way of retrieving the images within the RSS feed? I would like to be able to retrieve either one or all of the images in order to show a thumbnail image.
Oct 7, 2008 at 11:35 PM
I have the same issue with the latest version of the RSS Toolkit. I am using this feed from the AP: http://hosted.ap.org/lineups/TOPHEADS-rss_2.0.xml?SITE=NYUTI&SECTION=HOME.
Dec 10, 2008 at 8:34 AM
I'm not too sure about a thumbnail, but the RSS specification says you can provide an ENCLOSURE element which describes the type of media item (image, audio, etc) for the rss feed. I suppose it's up to the rss reader, how it wants to render that.

And yes, this toolkit does provide the ability.

here's some sample code i have...


// Determine the enclosure (read: image or video) link.
                RssEnclosure enclosure;
                string imageLink = "http://your.website.com/";
                switch (post.PostType)
                {
                    case PostType.Image:
                        enclosure = new RssEnclosure {Url = (imageLink + post.Content), Type = "image/png"};
                        break;
                    default:
                        enclosure = null;
                        break;
                }

                rssDocument.Channel.Items.Add(new RssItem
                                                  {
                                                      Title = "Your.Website.com - Some Title here",
                                                      Description = "Blah blah blah",
                                                      Enclosure = enclosure
                                                  });


hth.
Dec 11, 2009 at 2:14 PM

I have the opposite problem. I have IMG tage pointing to the images from my website but need a parse them from the RSSToolkit Datasource.  It throws the formatting off when I display the feed in a small column.

Does anyone know if this control has this feature or if a developer may have this code already published somewhere?

Thanks!

Vince