After googling, I got the code to access rss feed for sharepoint list as follows:
protected static void GetRSS(string ListRssUrl, SPWeb oWeb)
{
string rss_text = string.Empty;
string title = string.Empty;
string link = string.Empty;
string description = string.Empty;
string athr = string.Empty;
string pub = string.Empty;
XPathDocument doc = new XPathDocument(ListRssUrl);
XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator items = nav.Select("//item");
while (items.MoveNext())
{
XPathNavigator navCurrent = items.Current;
title = navCurrent.SelectSingleNode("title").InnerXml;
link = navCurrent.SelectSingleNode("link").InnerXml;
description = navCurrent.SelectSingleNode("description").InnerXml;
athr = navCurrent.SelectSingleNode("author").InnerXml;
pub = navCurrent.SelectSingleNode("pubDate").InnerXml;
}
}
//To get rss feed url use the below code.
using (SPSite oSite = new SPSite("<Site URL>"))
{
using (SPWeb oWeb = oSite.OpenWeb())
{
SPList list = oWeb.Lists["Contributor"];
string ListRssUrl = oWeb.Url + "/_layouts/listfeed.aspx?list=" + list.ID;
GetRSS(ListRssUrl, oWeb);
}
}
For List rss feed, roy need to enable Anonymous access. There is a good Link for this
Click here to view How to enable Anonymous access.
I have get very good reference here for rss feed.
protected static void GetRSS(string ListRssUrl, SPWeb oWeb)
{
string rss_text = string.Empty;
string title = string.Empty;
string link = string.Empty;
string description = string.Empty;
string athr = string.Empty;
string pub = string.Empty;
XPathDocument doc = new XPathDocument(ListRssUrl);
XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator items = nav.Select("//item");
while (items.MoveNext())
{
XPathNavigator navCurrent = items.Current;
title = navCurrent.SelectSingleNode("title").InnerXml;
link = navCurrent.SelectSingleNode("link").InnerXml;
description = navCurrent.SelectSingleNode("description").InnerXml;
athr = navCurrent.SelectSingleNode("author").InnerXml;
pub = navCurrent.SelectSingleNode("pubDate").InnerXml;
}
}
//To get rss feed url use the below code.
using (SPSite oSite = new SPSite("<Site URL>"))
{
using (SPWeb oWeb = oSite.OpenWeb())
{
SPList list = oWeb.Lists["Contributor"];
string ListRssUrl = oWeb.Url + "/_layouts/listfeed.aspx?list=" + list.ID;
GetRSS(ListRssUrl, oWeb);
}
}
For List rss feed, roy need to enable Anonymous access. There is a good Link for this
Click here to view How to enable Anonymous access.
I have get very good reference here for rss feed.


