Update
This commit is contained in:
parent
45feb2c5a5
commit
b3b194cb7c
2 changed files with 11 additions and 4 deletions
|
@ -15,6 +15,7 @@ publish = false
|
||||||
anyhow = { version = "1.0.66", features = ["backtrace"] }
|
anyhow = { version = "1.0.66", features = ["backtrace"] }
|
||||||
chrono = { version = "0.4.23", features = ["serde"] }
|
chrono = { version = "0.4.23", features = ["serde"] }
|
||||||
cookie = "0.16.1"
|
cookie = "0.16.1"
|
||||||
|
csv = "1.1.6"
|
||||||
reqwest = { version = "0.11.13", features = ["json"] }
|
reqwest = { version = "0.11.13", features = ["json"] }
|
||||||
serde = { version = "1.0.150", features = ["derive"] }
|
serde = { version = "1.0.150", features = ["derive"] }
|
||||||
serde_json = "1.0.89"
|
serde_json = "1.0.89"
|
||||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -783,9 +783,8 @@ impl Client {
|
||||||
bail!("Report not finished");
|
bail!("Report not finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut records_url = self
|
let mut records_url = self.webuntis_url.join("reports.do")?;
|
||||||
.webuntis_url
|
records_url.set_query(Some(&resp.data.report_params));
|
||||||
.join(&format!("reports.do?{}", resp.data.report_params))?;
|
|
||||||
dbg!(&records_url);
|
dbg!(&records_url);
|
||||||
records_url
|
records_url
|
||||||
.query_pairs_mut()
|
.query_pairs_mut()
|
||||||
|
@ -807,7 +806,14 @@ impl Client {
|
||||||
.await?
|
.await?
|
||||||
.text()
|
.text()
|
||||||
.await?;
|
.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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue