https://github.com/dncuug/X.Web.RSS
Library to read and write valid rss
https://github.com/dncuug/X.Web.RSS
List: X.Web.RSS
asp-net asp-net-core asp-net-mvc awesome awesome-dot-net-core awesome-list net-core rss rss-feed-parser rss-generator
Last synced: 4 months ago
JSON representation
Library to read and write valid rss
- Host: GitHub
- URL: https://github.com/dncuug/X.Web.RSS
- Owner: dncuug
- License: mit
- Fork: true (ApmeM/Simple-RSS)
- Created: 2013-03-25T17:35:00.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2025-02-10T18:49:22.000Z (5 months ago)
- Last Synced: 2025-03-16T14:03:40.248Z (4 months ago)
- Topics: asp-net, asp-net-core, asp-net-mvc, awesome, awesome-dot-net-core, awesome-list, net-core, rss, rss-feed-parser, rss-generator
- Language: C#
- Homepage: https://nuget.org/packages/X.Web.RSS
- Size: 209 KB
- Stars: 27
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# X.Web.RSS
[](https://www.nuget.org/packages/X.Web.RSS/)
[](https://twitter.com/andrew_gubskiy)X.Web.RSS is a .NET library designed for generating and managing RSS feeds. It provides an easy-to-use API for
creating and manipulating RSS feed elements, making it simple to integrate RSS functionality into .NET applications.## W3C Validation
RSS feeds which generated by this library successfully pass W3C validation.
You can test your RSS feeds at http://validator.w3.org/feed.## ⚠️Breaking changes
This version contain some important breaking changes:
* Serialization logic was moved to `RssDocumentSerializer` class.
* `RssDocument` and all other entities converted from `class` to `record`.## Usage example
To read foreign rss feed you need to get stream with rss data and call `RssDocument.Load`
```csharpvar request = WebRequest.Create("http://example.org/rss/");
var response = request.GetResponse();
var stream = response.GetResponseStream();
Rss rss = RssDocument.Load(stream);
Assert.AreEqual("Example", rss.Channel.Title);
```### RSS object creating example
Complete rss object will look like this:
```csharpreturn 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.Thursday, Day.Wednesday },
SkipHours = new List { 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
{
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") }
}
}
}
};
```