lib-messenger-archive

Crates.iolib-messenger-archive
lib.rslib-messenger-archive
version0.1.0
sourcesrc
created_at2024-04-29 12:43:11.917917
updated_at2024-04-29 12:43:11.917917
descriptionA library to read the MSN / Windows Live Messenger conversation archives.
homepage
repositoryhttps://github.com/sylvainbx/lib-messenger-archive/
max_upload_size
id1224148
size43,248
Sylvain (sylvainbx)

documentation

README

Lib-messenger-archive

This library read a file at the given path and try to interpret it as a valid MSN Messenger / Windows Live Messenger conversation archive.

If it is a valid archive, it returns an iterator to read the various messages contained in the archive.

Archives generated by the Messenger Plus! plugin are supported too.

Usage exemple

This simple example above only prints the textual content, unformatted:

    use lib_messenger_archive::{Parser, Data};
    
    let file = "test/alice1234.xml";
    let mut parser = Parser::new(file).expect("unable to read the archive");
    println!("Messages in archive \"{}\":\n---", file);
    while let Some(message) = parser.next() {
        if let Ok(msg) = message {
            let msg_txts: Vec<&str> = msg.data
                .iter()
                .filter_map(|d| match d {
                    Data::Text(txt) => Some(txt.content.as_str()),
                    _ => None,
                })
                .collect();
            println!("{}: {}", msg.sender_friendly_name, msg_txts.join(""));
        }
    }
    let details = parser.details().unwrap();
    println!("---\nThose messages were exchanged with: {}", details.recipient_id);
Commit count: 13

cargo fmt