forked from Anri/cal8tor
format
This commit is contained in:
parent
090a16433d
commit
b621436483
1 changed files with 16 additions and 16 deletions
|
@ -71,9 +71,9 @@ pub async fn timetable(
|
||||||
.capitalize();
|
.capitalize();
|
||||||
|
|
||||||
let startime = matches
|
let startime = matches
|
||||||
.name("startime")
|
.name("startime")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str();
|
.as_str();
|
||||||
|
|
||||||
let binding = i.select(&sel_b).last().unwrap().inner_html();
|
let binding = i.select(&sel_b).last().unwrap().inner_html();
|
||||||
let course = models::Course{
|
let course = models::Course{
|
||||||
|
@ -91,21 +91,21 @@ pub async fn timetable(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
name: matches
|
name: matches
|
||||||
.name("name")
|
.name("name")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str().to_owned(),
|
.as_str().to_owned(),
|
||||||
professor: if let Some(raw_prof) = i.select(&sel_small).last() {
|
professor: if let Some(raw_prof) = i.select(&sel_small).last() {
|
||||||
match raw_prof.inner_html() {
|
match raw_prof.inner_html() {
|
||||||
i if i.starts_with("<span") => None,
|
i if i.starts_with("<span") => None,
|
||||||
i => Some(i),
|
i => Some(i),
|
||||||
}
|
}
|
||||||
} else { None },
|
} else { None },
|
||||||
room: Regex::new(r"(<table.*<\/table>|<br>.*?<br>.*?)?<br>(?P<location>.*?)<br>")
|
room: Regex::new(r"(<table.*<\/table>|<br>.*?<br>.*?)?<br>(?P<location>.*?)<br>")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.captures(&binding)
|
.captures(&binding)
|
||||||
.unwrap().name("location")
|
.unwrap().name("location")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str().to_owned(),
|
.as_str().to_owned(),
|
||||||
start: schedules.iter().position(|r| r.starts_with(startime)).unwrap(),
|
start: schedules.iter().position(|r| r.starts_with(startime)).unwrap(),
|
||||||
size: i.value().attr("rowspan").unwrap().parse::<usize>().unwrap(),
|
size: i.value().attr("rowspan").unwrap().parse::<usize>().unwrap(),
|
||||||
dtstart: None,
|
dtstart: None,
|
||||||
|
|
Loading…
Reference in a new issue