How to Generate an Rss Feed using System.ServiceModel.Syndication Framework. Part 3

Syndication-Feed provides all the properties we will need to generate a feed for our web site. This article assumes that you have a Data Access layer, which could provide the objects / content and other information needed to publish a feed. I will be using sample variables and objects, which you can replace with originals content / objects

           // Create a raw SyndicationFeed object
            SyndicationFeed feed = new SyndicationFeed();

            // Set the title for the Feed
            feed.Title = new TextSyndicationContent(" articles");

            // set the language you Feed is published in
            feed.Language = "en-gb";

            // set the description for the Feed / Feed resource
            feed.Description = new TextSyndicationContent("Latest Content from");

            // set the rights information that apply over 
            // the consumption / distribution of the  
            // Feed / content
            feed.Copyright = new TextSyndicationContent("CC");

            // Set the categories under the Feed / content is published
            feed.Categories.Add(new SyndicationCategory("RssFeed"));
            feed.Categories.Add(new SyndicationCategory("cSharp"));
            feed.Categories.Add(new SyndicationCategory("SyndicationFeed"));

            // Set the information about the feed Generator Engine
            feed.Generator = "WordPress3.0";

            // Add the List of Post / Articles / content links 
            // and information to the Feed Object
            List<SyndicationItem> feedItems = new List<SyndicationItem>();

            SyndicationItem feedItem1 =
                new SyndicationItem(
                    "Really simple syndication -RSS with .Net. (Intro)",
                    "Rss Feed Fameworks",
                    new Uri(""));

            SyndicationItem feedItem2 =
                new SyndicationItem(
                    "How to consume an Rss feed using System."+
                    "ServiceModel.Syndication Framework. (Part 1)",
                    "Consume Rss Feed",
                    new Uri(""+

            SyndicationItem feedItem3 =
                new SyndicationItem(
                    "How to consume an Atom feed using Argotic Framework. (Part 2)",
                    "Consume Atom Feed",
                    new Uri(""+

            // Set the url forthe image / logo for your Feed
            // Displayed on the side of the feed page
            feed.ImageUrl = new Uri("");

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s