diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Regexes.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Regexes.kt index e928f40b..9d084059 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Regexes.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Regexes.kt @@ -85,8 +85,8 @@ object Regexes { - val EDUDZIENNIK_STUDENT_ID by lazy { - """/Students/([\w-_]+?)/""".toRegex() + val EDUDZIENNIK_STUDENT_START_ID by lazy { + """/Students/([\w-_]+?)/start""".toRegex() } val EDUDZIENNIK_SUBJECT_ID by lazy { """/Courses/([\w-_]+?)/""".toRegex() @@ -94,6 +94,9 @@ object Regexes { val EDUDZIENNIK_TEACHER_ID by lazy { """/Teachers/([\w-_]+?)/""".toRegex() } + val EDUDZIENNIK_GRADE_ID by lazy { + """/Grades/([\w-_]+?)/""".toRegex() + } val EDUDZIENNIK_SCHOOL_DETAIL_ID by lazy { """ Unit val doc = Jsoup.parse(text) val accountName = doc.select("#user_dn").first().text().fixName() - doc.select("ul ul > li").first().children().forEach { - val studentId = EDUDZIENNIK_STUDENT_ID.find(it.attr("href"))?.get(1) + doc.select("ul ul").first().select("li > a").forEach { + val studentId = EDUDZIENNIK_STUDENT_START_ID.find(it.attr("href"))?.get(1) if (studentId.isNullOrBlank()) return@forEach val studentName = it.text().fixName()