Skip to content

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

License

Notifications You must be signed in to change notification settings

tugberkugurlu/WxrNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 and supports .NET 4.5 and .NET Standard 1.0.

Install-Package WxrNet

Example

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 <a href=\"http://example.com\">my site</a> 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> { comment };

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

var serializedContent = WxrSerializer.Serialize(wxr);

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages