Reading non-standard elements in a SyndicationItem with SyndicationFeed

This should give you an idea on how to do it: using System.Linq; using System.ServiceModel.Syndication; using System.Xml; using System.Xml.Linq; SyndicationFeed feed = reader.Read(); foreach (var item in feed.Items) { foreach (SyndicationElementExtension extension in item.ElementExtensions) { XElement ele = extension.GetObject<XElement>(); Console.WriteLine(ele.Value); } }

How can I get started making a C# RSS Reader?

See http://msdn.microsoft.com/en-us/library/bb943474.aspx http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.syndicationfeed.aspx http://msdn.microsoft.com/en-us/library/bb943480.aspx Basically there is a lot of stuff in the .Net 3.5 framework that does the grunt-work of parsing and representing feeds; it’s not hard to write a 30-line app that takes in a feed URL and downloads the feed and prints the title and author of all the items, for example. … Read more

Best Way to read rss feed in .net Using C# [closed]

Add System.ServiceModel in references Using SyndicationFeed: string url = “http://fooblog.com/feed”; XmlReader reader = XmlReader.Create(url); SyndicationFeed feed = SyndicationFeed.Load(reader); reader.Close(); foreach (SyndicationItem item in feed.Items) { String subject = item.Title.Text; String summary = item.Summary.Text; … }

How do I parse and convert DateTime’s to the RFC 822 date-time format?

Try this: DateTime today = DateTime.Now; String rfc822 = today.ToString(“r”); Console.WriteLine(“RFC-822 date: {0}”, rfc822); DateTime parsedRFC822 = DateTime.Parse(rfc822); Console.WriteLine(“Date: {0}”, parsedRFC822); The “r” format specifier passed into DateTime’s ToString() method actually yields an RFC-1123-formatted datetime string, but passes as an RFC-822 date as well, based on reading the specification found at http://www.w3.org/Protocols/rfc822/#z28. I’ve used this … Read more

RSS Feeds in ASP.NET MVC

The .NET framework exposes classes that handle syndation: SyndicationFeed etc. So instead of doing the rendering yourself or using some other suggested RSS library why not let the framework take care of it? Basically you just need the following custom ActionResult and you’re ready to go: public class RssActionResult : ActionResult { public SyndicationFeed Feed … Read more

Using SimpleXML to read RSS feed

As you already know, SimpleXML lets you select an node’s child using the object property operator -> or a node’s attribute using the array access [‘name’]. It’s great, but the operation only works if what you select belongs to the same namespace. If you want to “hop” from a namespace to another, you can use … Read more