Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # X.Web.RSS
- [![NuGet version](https://badge.fury.io/nu/xwebrss.svg)](https://badge.fury.io/nu/xwebrss)
- [![Part of awesome .NET Core](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/thangchung/awesome-dotnet-core#tools)
- This project you also can download from Nuget.org at http://nuget.org/packages/xwebrss/
- ## W3C Validagtion ![Valid RSS](https://validator.w3.org/feed/images/valid-rss-rogers.png)
- RSS feeds which generated by this library successfully pass W3C validation.
- You can test your RSS feeds at http://validator.w3.org/feed.
- ## 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.org/rss/");
- var response = request.GetResponse();
- var stream = response.GetResponseStream();
- Rss rss = RSSHelper.ReadRSS(stream);
- Assert.AreEqual("Example", rss.Channel.Title);
- ### 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("managingEditor@mail.com (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("webmaster@mail.example.com (webmaster)"),
- Items =
- new List<RssItem>
- {
- new RssItem
- {
- Author = new RssEmail("item.author@mail.example.com (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") }
- }
- }
- }
- };
- ## Get a digital subscription for project news
- [Subscribe](https://twitter.com/intent/user?screen_name=andrew_gubskiy) to my Twitter to keep up-to-date with project news and receive announcements.
- [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/andrew_gubskiy.svg?style=social&label=Follow%20%40andrew_gubskiy)](https://twitter.com/andrew_gubskiy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement