I wrote a code snippet to extract elementary information from an Atom feed (e.g. a SO feed) using a LINQ to XML query.
I'd like to know if there are be cases when this code could fail or if there are more elegant ways.
Thanks for the support.
var url = @"http://stackoverflow.com/feeds";
XDocument rss = XDocument.Load(url);
var q = from i in rss.Root.Elements("{http://www.w3.org/2005/Atom}entry")
select new {
Title = i.Element("{http://www.w3.org/2005/Atom}title").Value,
URL = i.Element("{http://www.w3.org/2005/Atom}link").Attribute("href").Value};