I try to use this example to get images urls from http://www.nydailynews.com/cmlink/NYDN.Article.rss
but no success
Could u help me to find all correct ways to gets all possible image URLs from RSS feed item by SyndicationItem
class?
There is draft solution here but I guess should be more generic solution.
Thank you!
List<RssFeedItem> rssItems = new List<RssFeedItem>();
Stream stream = e.Result;
XmlReader response = XmlReader.Create(stream);
SyndicationFeed feeds = SyndicationFeed.Load(response);
foreach (SyndicationItem f in feeds.Items)
{
RssFeedItem rssItem = new RssFeedItem();
rssItem.Description = f.Summary.Text;
foreach (SyndicationLink enclosure in f.Links.Where<SyndicationLink>(x => x.RelationshipType == "enclosure"))
{
Uri url = enclosure.Uri;
long length = enclosure.Length;
string mediaType = enclosure.MediaType;
rssItem.ImageLinks.Add(url.AbsolutePath);
}
}