diff options
-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(); } } |