RSS laden

public class Lezer
{
    public static IEnumerable<RSS> GetFeed()
    {

        XDocument xml = XDocument.Load("http://www.nieuwsblad.be/rss.aspx?intro=1&section=postcode&postcode=8940");
        var gegevens = (from story in xml.Descendants("item")
                        select new RSS
                        {
                            Title = ((string)story.Element("title")),
                            Link = ((string)story.Element("link")),
                            Summary = ((string)story.Element("description")),
                            Date = ((string)story.Element("pubDate")),
                        }).Take(5);
        return gegevens;
    }
}

 

Categories:

Related Article