What is the best way to read RSS feeds?
I am using XmlTextReader
to achieve this. Is there any other best way to do it?
XmlTextReader reader = new XmlTextReader(strURL);
DataSet ds = new DataSet();
ds.ReadXml(reader);
After reading the RSS feed using XmlTextReader
, is there any way I can populate data to ListItem
instead of DataSet
?
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;
...
}