I'm trying to get the image value out of CNN's RSS feed, but I'm having problems trying to get it.
What I after is the value from
<media:content medium="image"
url="https://cdn.cnn.com/cnnnext/dam/assets/180513143656-police-masks-surabaya-hp-video.jpg"
height="144"
width="256" />
With the code below I can see what I'm after, but I just cannot retrieve the value.
foreach (SyndicationElementExtension extension in f.ElementExtensions)
{
XElement element = extension.GetObject<XElement>();
if (element.HasAttributes)
{
foreach (var attribute in element.Attributes())
{
//How to get value here
}
}
}
How do I retrieve the image value?
You can achive this by using Linq.
Dont forget the using: