Crates.io | parse-blogger-backup-xml |
lib.rs | parse-blogger-backup-xml |
version | 0.1.3 |
source | src |
created_at | 2022-02-18 14:13:11.017038 |
updated_at | 2022-02-18 14:21:44.797605 |
description | Parse a blogger backup.xml file into posts with comments. |
homepage | |
repository | https://github.com/dhbradshaw/parse-blogger-backup-xml |
max_upload_size | |
id | 534713 |
size | 26,633 |
I had the need to parse a series of backup xml files from Blogger into Rust to manipulate further and I wrote some rough code to do it.
So that the code doesn't get lost, I'm open sourcing it here.
Basically, it uses quick-xml to walk through the xml and turns that event stream into a list of entries of different types.
It then connects comments to their post parents and returns the data.
It makes no effort to parse the html stored, but just adds it as a string to the Post or Comment instance.
Provide the get_posts
function with a path string showing it where to look for your backup file.
It will return post objects that you can then manipulate.