public static List<RssFeedItem> ReadRssFeed(string url)
            //create a new list of the rss feed items to return
            List<RssFeedItem> rssFeedItems = new List<RssFeedItem>();

            //create an http request which will be used to retrieve the rss feed
            HttpWebRequest rssFeed = (HttpWebRequest)WebRequest.Create(url);
            rssFeed.Timeout = 200000;

            //use a dataset to retrieve the rss feed
            using (DataSet rssData = new DataSet())
                //read the xml from the stream of the web request

                //loop through the rss items in the dataset and populate the list of rss feed items
                foreach (DataRow dataRow in rssData.Tables[“item”].Rows)
                    rssFeedItems.Add(new RssFeedItem
                        Title = Convert.ToString(dataRow[“title”]),
                        PublishDate = Convert.ToDateTime(dataRow[“pubDate”]),
                        Description = Convert.ToString(dataRow[“description”]),
                        Link = Convert.ToString(dataRow[“link”])

            //return the rss feed items
            return rssFeedItems;

Leave a Reply

Your email address will not be published. Required fields are marked *