This commit is contained in:
Dominic Grimm 2023-01-27 19:11:00 +01:00
parent 45feb2c5a5
commit b3b194cb7c
No known key found for this signature in database
GPG key ID: 6F294212DEAAC530
2 changed files with 11 additions and 4 deletions

View file

@ -15,6 +15,7 @@ publish = false
anyhow = { version = "1.0.66", features = ["backtrace"] }
chrono = { version = "0.4.23", features = ["serde"] }
cookie = "0.16.1"
csv = "1.1.6"
reqwest = { version = "0.11.13", features = ["json"] }
serde = { version = "1.0.150", features = ["derive"] }
serde_json = "1.0.89"

View file

@ -783,9 +783,8 @@ impl Client {
bail!("Report not finished");
}
let mut records_url = self
.webuntis_url
.join(&format!("reports.do?{}", resp.data.report_params))?;
let mut records_url = self.webuntis_url.join("reports.do")?;
records_url.set_query(Some(&resp.data.report_params));
dbg!(&records_url);
records_url
.query_pairs_mut()
@ -807,7 +806,14 @@ impl Client {
.await?
.text()
.await?;
dbg!(records);
let mut reader = csv::ReaderBuilder::new()
.delimiter(b'\t')
.from_reader(records.as_bytes());
for record in reader.records() {
let record = record?;
dbg!(record);
}
Ok(())
}