Giter Site home page Giter Site logo

x.web.rss's Introduction

X.Web.RSS

This project you also can download from Nuget.org at http://nuget.org/packages/xwebrss/

Introduction

Easy to use library to create simple rss feeds and read foreign rss feeds.

All processes are based on XmlSerializer and can be used as an example of how to use XmlSerializer :)

Usage example

To read foreign rss feed you need to get stream with rss data and call RSSHelper.ReadRSS

var request = WebRequest.Create("http://example.com/rss/");
var response = request.GetResponse();
var stream = response.GetResponseStream();
var rss = RssDocument.Load(stream);

RSS object creating example

Complete rss object will looks like this:

return new RssDocument
        {
            Channel =
                new RssChannel
                {
                    AtomLink = new RssLink { Href = new RssUrl("http://atomlink.com"), Rel = Rel.self, Type = "text/plain" },
                    Category = "category",
                    Cloud =
                        new RssCloud
                        {
                            Domain = "domain",
                            Path = "path",
                            Port = 1234,
                            Protocol = Protocol.xmlrpc,
                            RegisterProcedure = "registerProcedure"
                        },
                    Copyright = "copyrignt (c)",
                    Description = "long description",
                    Image =
                        new RssImage
                        {
                            Description = "Image Description",
                            Height = 100,
                            Width = 100,
                            Link = new RssUrl("http://image.link.url.com"),
                            Title = "title",
                            Url = new RssUrl("http://image.url.com")
                        },
                    Language = new CultureInfo("en"),
                    LastBuildDate = new DateTime(2011, 7, 17, 15, 55, 41),
                    Link = new RssUrl("http://channel.url.com"),
                    ManagingEditor = new RssEmail("[email protected] (manager)"),
                    PubDate = new DateTime(2011, 7, 17, 15, 55, 41),
                    Rating = "rating",
                    SkipDays = new List<Day> { Day.Thursday, Day.Wednesday },
                    SkipHours = new List<Hour> { new Hour(22), new Hour(15), new Hour(4) },
                    TextInput =
                        new RssTextInput
                        {
                            Description = "text input desctiption",
                            Link = new RssUrl("http://text.input.link.com"),
                            Name = "text input name",
                            Title = "text input title"
                        },
                    Title = "channel title",
                    TTL = 10,
                    WebMaster = new RssEmail("[email protected] (webmaster)"),
                    Items =
                        new List<RssItem>
                                    {
                                        new RssItem
                                            {
                                                Author = new RssEmail("[email protected] (author)"),
                                                Category =
                                                    new RssCategory
                                                        {
                                                            Domain = "category domain value", 
                                                            Text = "category text value"
                                                        },
                                                Comments = new RssUrl("http://rss.item.comment.url.com"),
                                                Description = "item description",
                                                Enclosure =
                                                    new RssEnclosure
                                                        {
                                                            Length = 1234,
                                                            Type = "text/plain",
                                                            Url = new RssUrl("http://rss.item.enclosure.type.url.com")
                                                        },
                                                Link = new RssUrl("http://rss.item.link.url.com"),
                                                PubDate = new DateTime(2011, 7, 17, 15, 55, 41),
                                                Title = "item title",
                                                Guid = new RssGuid { IsPermaLink = false, Value = "guid value" },
                                                Source = new RssSource { Url = new RssUrl("http://rss.item.source.url.com") }
                                            }
                                    }
                }
        };

Features

Resulted rss are valid for w3c rss validator located at http://validator.w3.org/feed/

x.web.rss's People

Contributors

apmem avatar ernado-x avatar leon737 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.