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?
XmlText
Use this :
private string GetAlbumRSS(SyndicationItem album)
{
string url = "";
foreach (SyndicationElementExtension ext in album.ElementExtensions)
if (ext.OuterName == "itemRSS") url = ext.GetObject();
return (url);
}
protected void Page_Load(object sender, EventArgs e)
{
string albumRSS;
string url = "http://www.SomeSite.com/rss";
XmlReader r = XmlReader.Create(url);
SyndicationFeed albums = SyndicationFeed.Load(r);
r.Close();
foreach (SyndicationItem album in albums.Items)
{
cell.InnerHtml = cell.InnerHtml +string.Format("
{1}", album.Links[0].Uri, album.Title.Text);
albumRSS = GetAlbumRSS(album);
}
}