Public Release of ItSoftware.Syndication

  • .NET
  • Published: 2014-09-04 12:18:56 +00:00

Back in 2004 I created a syndication library for consuming and creating RSS/RDF/ATOM feeds. This library has been lying around for many years and I finally decided to make it public by making it downloadable from my homepage

This blog post will show some code examples and explain a little about how to use the library.

The first thing to show is how to create an RSS feed. I will not show how to create RDF or ATOM feeds because they follow the same procedure albeit other classes, and if you understand RSS you will understand the creation of RDF and ATOM as well. Note however that RSS/RDF and ATOM lie in their own namespaces.

In the following example, note that we use namespace extensions to the RSS feed using the SyndicationModule and SyndicationModuleCollection objects.

Rss rss = new Rss();
rss.Channel.Category.Add(new RssCategory(".NET"));
rss.Channel.Cloud = new RssCloud("", "80", "path", "registerProcedure", "soap");
rss.Channel.Copyright = "Copyright (c) Kjetil Kristoffer Solberg";
rss.Channel.Description = "Description here.";
rss.Channel.Generator = "ItSoftware.Syndication";
rss.Channel.Language = "English";
rss.Channel.PubDate = RssDateTime.ToString(DateTime.Now, new TimeSpan(1, 0, 0));
rss.Channel.Title = "Showcase RSS feed.";
rss.Channel.Description = "RSS Channel Description.";
rss.Channel.Link = "";

RssItem item = new RssItem();

item.Title = "A blog about a C# LINQ Provider";
item.PubDate = new RssDateTime(DateTime.Now, new TimeSpan(1, 0, 0)).ToString();
item.Link = "http://www.mylinkdomain.domain/rss.aspx?T=123";
item.Description = "I've just created a C# linq provider...";
item.Author = "Kjetil Kristoffer Solberg";
item.Category = new RssCategoryCollection();
item.Category.Add(new RssCategory(".NET"));
item.Category.Add(new RssCategory("C#"));
item.Category.Add(new RssCategory("LINQ"));
item.Comments = "http://www.mylinkdomain.domain/rss.aspx?T123#WhatDoYouThink";
item.GUID = new RssGuid(Guid.NewGuid().ToString(),"true");

item.Modules = new ItSoftware.Syndication.SyndicationModuleCollection();

SyndicationModule moduleCommentRss = item.Modules.Add( new SyndicationModule("wfw", "", SyndicationModuleNamespacePosition.DocumentElement));

SyndicationModuleElement moduleElementCommentRss = new SyndicationModuleElement("commentRss", "http://www.mydomain.domain/rss.aspx?T=123&C=1",

SyndicationModule moduleComments = item.Modules.Add( new SyndicationModule("slash", "", SyndicationModuleNamespacePosition.DocumentElement));
SyndicationModuleElement moduleElementComments = new SyndicationModuleElement("comments", "1", SyndicationModuleElementValueType.InnerText);

string rssXml = rss.Save(RssVersion.RSS_2_0_1, "utf-8").OuterXml;

To consume RSS/RDF and ATOM feeds you just do the following. Note that the uri could be a local file uri or http/ftp uri.

    SyndicationBase sb = Syndication.Load(new    Uri(""));
    if (sb is Rss)
        // We have a RSS feed. Consume rss object.
        Rss rss = sb as Rss;
    else if (sb is Rdf)
        // We have a RDF feed. Consume rdf object.
        Rdf rdf = sb as Rdf;
    else if (sb is Atom)
        // We have an ATOM feed. Consume ATOM object.
        Atom atom = sb as Atom;
catch (System.Net.WebException )
    // Invalid http/ftp uri
catch ( SyndicationFormatInvalidException )
    // Invalid syndication format

The next sample shows a simple F# console application that retrieves the current weather and prints it to the console

namespace WeatherHaugesund

open System
open System.Net
open ItSoftware.Syndication
open ItSoftware.Syndication.Rss

module ModuleMain =
 let main(args : string[]) =
  let url = ""
  let sb : SyndicationBase = Syndication.Load(new Uri(url))
  let rss : Rss = sb :?> Rss
  printf "\n\n## Today ##\n%s\n\n" rss.Channel.Items.[0].Description

These three examples should be all that you need to understand how to create and consume syndication feeds.

Note that you could also load the syndication feed from a string using the Syndication.LoadSyndication method.


Carl Kennedy

2017-03-28 13:26:59

Cool ;)


2018-07-17 10:37:08

I am really glad that I chose them for my desired work and problem because they have given me the results out of this world! Simply magnificent! Suggested to all!

2018-09-11 06:41:05

Excellent Blog! I have been impressed by your thoughts and the way you

Online Slots Real Money

2018-10-12 07:29:44

Hi I was searching for the blogs for many times, now I have reached at the right place.

Purple Heart Donation

2018-10-17 07:00:35

Every week-end I used to pay a fast visit this site, because I’d like enjoyment, because this web site conations certainly fussy material.


2018-10-18 10:49:15

I’m impressed with the special and informative contents that you just offer in such short timing.

seo services

2018-10-19 11:17:32

These are actually wonderful some ideas in the blog. You have touched good quality points here. In whatever way continue writing.

locksmith in arlington tx

2018-10-24 06:31:25

I suppose I've selected an unbelievable and interesting blog.

Thank you so much for such a great blog.


2018-11-10 06:04:27

If somebody wants expert take on the main topic of blogging next I advise him/her to go to this site, continue the fussy job.


2018-11-12 05:47:45

If somebody wants expert take on the main topic of blogging next I advise him/her to go to this site, continue the fussy job.


2018-12-05 05:22:05

It's not my very first time to visit this blog; I’m visiting this daily and acquire superb info from here day by day.

Native American lender

2018-12-11 05:44:42

Each time I used to always check blog posts within the first hours in the break of day, because I like to get information increasingly more.

tubemate mp3 + youtube + download

2018-12-31 16:07:46

I think I have really come on the right place for getting the perfect info.


2019-01-03 07:44:12

I really need this kind of inspiration; your content did teach me so much interesting ideas.

youtube mate

2019-01-06 17:21:46

Great details here, better yet to discover out your blog which is fantastic. Nicely done!!!

2019-05-20 11:09:28

Add comment

(no html)

Copyright © 2006 - 2019 Kjetil Kristoffer Solberg