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
- Host: GitHub
- URL: https://github.com/tugberkugurlu/wxrnet
- Owner: tugberkugurlu
- License: mit
- Created: 2017-01-08T23:08:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-10T00:34:19.000Z (almost 9 years ago)
- Last Synced: 2025-06-05T05:02:55.014Z (5 months ago)
- Topics: disqus, wxr
- Language: C#
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```