fix MensaParser & update spring boot, kotlin
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

* fixed the MensaParser(), it should now work more reliable
* updated spring boot 2.2.4 -> 2.2.5
* updated kotlin 1.3.61 -> 1.3.70
* clean up MensaParserTest
This commit is contained in:
2020-03-03 19:31:12 +01:00
parent c22f752788
commit 678a97f140
10 changed files with 256 additions and 265 deletions

View File

@ -63,9 +63,9 @@ class MensaParser {
.forEachIndexed { dayIndex, day ->
val strDay = day.select("h3").text()
day.select("div.menu-info").forEachIndexed { mealIndex, meal ->
val heading = day.select("h4")[mealIndex].text()
val parts = ArrayList(meal.html().substringBefore("<br>\n").replace("\n", "").split("<br>"))
day.select("div.row").forEachIndexed { mealIndex, meal ->
val heading = meal.select("h4.menu-header").text()
val parts = ArrayList(meal.select("div.menu-info").html().substringBefore("<br><span").replace("\n", "").split("<br>"))
val additives = meal.select("span.show-with-allergenes").text()
parts.removeIf { x -> x.isEmpty() || x.isBlank() }