https://github.com/danrigby/jsonfeed.net
JsonFeed.NET is a portable .NET library for generating and consuming JSON Feed (jsonfeed.org) compliant site feeds.
https://github.com/danrigby/jsonfeed.net
csharp dotnet jsonfeed
Last synced: 8 months ago
JSON representation
JsonFeed.NET is a portable .NET library for generating and consuming JSON Feed (jsonfeed.org) compliant site feeds.
- Host: GitHub
- URL: https://github.com/danrigby/jsonfeed.net
- Owner: DanRigby
- License: mit
- Created: 2017-05-25T00:05:38.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-04-21T15:31:02.000Z (9 months ago)
- Last Synced: 2025-04-21T16:35:01.276Z (9 months ago)
- Topics: csharp, dotnet, jsonfeed
- Language: C#
- Homepage:
- Size: 428 KB
- Stars: 12
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JsonFeed.NET
==============
JsonFeed.NET is a portable .NET library for generating and consuming [JSON Feed](https://jsonfeed.org/) compliant site feeds.
[](https://github.com/DanRigby/JsonFeed.NET/actions/workflows/build.yml) [](https://www.nuget.org/packages/JsonFeed.NET) [](https://twitter.com/DanRigby)
#### Supported platforms
* .NET Framework 4.5.1+
* .NET Core 1.1+
* Mono
* UWP
* Xamarin.iOS
* Xamarin.Android
## How To Install
`Install-Package JsonFeed.NET`
## Sample Usage
#### Parsing a JsonFeed from a string
```csharp
JsonFeed jsonFeed = JsonFeed.Parse(jsonFeedString);
```
#### Parsing a JsonFeed from a Url
```csharp
JsonFeed jsonFeed = await JsonFeed.ParseFromUriAsync(new Uri("https://jsonfeed.org/feed.json"));
```
#### Parsing a JsonFeed from a Url using a custom HttpMessageHandler
```csharp
JsonFeed jsonFeed = await JsonFeed.ParseFromUriAsync(new Uri("https://jsonfeed.org/feed.json"), new HttpClientHandler());
```
#### Creating a new JsonFeed and writing it to a string
```csharp
var jsonFeed = new JsonFeed
{
Title = "Dan Rigby",
Description = "Mobile App Development & More.",
HomePageUrl = @"https://danrigby.com",
FeedUrl = @"https://danrigby.com/feed.json",
Authors = new[] {
new JsonFeedAuthor
{
Name = "Dan Rigby",
Url = @"https://twitter.com/DanRigby",
}
},
Items = new List
{
new JsonFeedItem
{
Id = @"https://danrigby.com/2015/09/12/inotifypropertychanged-the-net-4-6-way/",
Url = @"https://danrigby.com/2015/09/12/inotifypropertychanged-the-net-4-6-way/",
Title = "INotifyPropertyChanged, The .NET 4.6 Way",
ContentText = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
DatePublished = new DateTime(2015, 09, 12)
}
}
};
string jsonFeedString = jsonFeed.Write();
```
#### Writing a JsonFeed to a stream
```csharp
JsonFeed jsonFeed = JsonFeed.Parse(inputJsonFeed);
jsonFeed.Write(stream);
```
## License
Copyright (c) 2023 Dan Rigby
Licensed under the [MIT license](https://github.com/DanRigby/JsonFeed.Net/blob/master/LICENSE).