diff options
author | Valentin Popov <info@valentineus.link> | 2019-01-27 17:26:23 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2019-01-27 17:26:23 +0300 |
commit | 7f9f743f6a0a899a5c045ebbe0911a8f89056909 (patch) | |
tree | 440c28442f578aa787beef922b9008b894f1b114 /src/parser.rs | |
parent | df30feeddf83e7ef8540bce1649acf437ca3489e (diff) | |
download | bbb2json-7f9f743f6a0a899a5c045ebbe0911a8f89056909.tar.xz bbb2json-7f9f743f6a0a899a5c045ebbe0911a8f89056909.zip |
Sun, 27 Jan 2019 18:26:23 +0400develop
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'src/parser.rs')
-rw-r--r-- | src/parser.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/parser.rs b/src/parser.rs index b2fe19a..1c862c4 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -6,10 +6,11 @@ use xml::reader::{EventReader, XmlEvent}; #[derive(Serialize)] pub struct ParserResult { + pub context: Value, pub external_id: String, pub meeting_id: String, pub meeting_name: String, - pub context: Value, + pub meeting_url: String, } pub fn parser(content: BufReader<File>) -> ParserResult { @@ -18,6 +19,7 @@ pub fn parser(content: BufReader<File>) -> ParserResult { external_id: "".to_string(), meeting_id: "".to_string(), meeting_name: "".to_string(), + meeting_url: "".to_string(), }; for element in EventReader::new(content) { @@ -35,15 +37,16 @@ pub fn parser(content: BufReader<File>) -> ParserResult { data.context = serde_json::from_str(&attr_value).unwrap(); } - if el_name == "meeting" && attr_name == "externalId" { + if el_name == "metadata" && attr_name == "meetingId" { data.external_id = attr_value.clone(); } - if el_name == "meeting" && attr_name == "id" { + if el_name == "recording" && attr_name == "meeting_id" { data.meeting_id = attr_value.clone(); + data.meeting_url = format!("{}{}", "https://bbb.styleschool.ru/playback/presentation/0.9.0/playback.html?meetingId=", attr_value); } - if el_name == "meeting" && attr_name == "name" { + if el_name == "metadata" && attr_name == "meetingName" { data.meeting_name = attr_value.clone(); } } |