An open API service indexing awesome lists of open source software.

https://github.com/tugberkugurlu/wxrnet

.NET Disqus migrator for custom XML import format based on the WXR (WordPress eXtended RSS) schema
https://github.com/tugberkugurlu/wxrnet

disqus wxr

Last synced: 6 days ago
JSON representation

.NET Disqus migrator for custom XML import format based on the WXR (WordPress eXtended RSS) schema

Awesome Lists containing this project

README

          

# WxrNet
.NET Disqus migrator for custom XML import format based on the WXR (WordPress eXtended RSS) schema. This is useful for sites importing comments to Disqus in an unsupported format.

## Installation

[WxrNet is available on NuGet](https://www.nuget.org/packages/WxrNet) and supports .NET 4.5 and .NET Standard 1.0.

```
Install-Package WxrNet
```

## Example

```csharp
var comment = new Comment();
comment.Id = "1212121";
comment.AuthorEmail = "foo@bar.com";
comment.AuthorFullName = "John Doe";
comment.AuthorUrl = "http://example.com";
comment.CommentDateInGmt = DateTime.Now.AddDays(-100);
comment.Content = new XmlDocument().CreateCDataSection("lorem ipsum lorem");
comment.IpAddress = "127.0.0.1";
comment.IsApproved = true;

var post = new Post();
post.Id = "1";
post.Title = "Foo Bar";
post.Content = new XmlDocument().CreateCDataSection("lorem ipsum my site loremlorem ipsum loremlorem ipsum lorem");
post.IsCommentsOpen = true;
post.Link = "http://example.com/foo-bar";
post.PostDateInGmt = DateTime.Now.AddDays(-150);
post.Comments = new List { comment };

var wxr = new Wxr();
wxr.Site = new Site { Posts = new List { post } };

var serializedContent = WxrSerializer.Serialize(wxr);
```