Script to parse Disqus Comment Export XML as documented at
https://help.disqus.com/en/articles/1717164-comments-export
and translate it into a JSON format that is easier to handle (for example, using Jekyll's built-in support for JSON files in _data
).
The imagined use case is if you have decided to remove Disqus comments from your blog (or maybe disable commenting entirely), but have existing comments on previous posts that you want to keep. You can export your comments from Disqus, and statically render the historical comments, without needing any Disqus Javascript or cookies.
The Disqus XML exports all categories, threads and posts into flat lists, with id references for parent relationships. That makes it complicated to do things like "look up all comments on this blog post", or see which comments were in reply to which, so this also reassembles the tree structure for easier usage.
This includes some bare-bones example HTML to demonstrate how to use the data. You will almost certainly want to edit the HTML and add some styling.
Feel to reuse this for your own blog. This could be packaged as a Jekyll generator gem if anyone