Since I just switched this blog to using Disqus for commenting, I wanted a way to back up comments in case something goes wrong (like, Disqus going the way of del.icio.us bookmarking).

I whipped up a quick Python script using the official Disqus Python API client. It grabs the forum details, threads list and posts (comments) list, and writes them out to a JSON file.

It doesn’t have any restore feature, but it captures all of the data.

My first test made it look like there may be some posts and theads missing (my import from wordpress showed 56 threads and 146 comments, but this script only grabbed 52 and 125 respectively), so exercise some caution until I verify what the problem is. If you happen to figure it out, please submit a PR.

The script is available on GitHub at https://github.com/jantman/misc-scripts/blob/master/disqus_backup.py.



Comments

comments powered by Disqus