Compare commits

..

7 Commits

Author SHA1 Message Date
f98dc3d808
Small improvements
- Improve formatting
- Fix some typos
- Mini code improvements
2021-10-13 16:39:01 +02:00
5d37c436ca
Make the update scheduling more readable (hopefully) 2021-10-13 16:18:10 +02:00
4e26a431cd
StatusController: use properties instead of getters 2021-10-13 16:18:10 +02:00
f5ea292c6e
Also set JVM target to 11 for Java 2021-10-13 16:18:10 +02:00
c5916c65ae
Dependency updates
This also replaces JCenter with Maven Central since JCenter is now read-only
2021-10-13 16:18:10 +02:00
cf979df46e
Timetable fixes
- Only one request is made to get the timetable HTML document for parsing the timetable and the weekNumberYear
- On timeouts or other errors, the cached data won't be overwritten with emptiness anymore
- The scheduled updates will now also update the weekNumberYear
2021-10-13 16:17:58 +02:00
b4f7f48590
Update Kotlin to 1.5.31 2021-10-13 15:46:17 +02:00
7 changed files with 45 additions and 37 deletions

30
.drone.yml Normal file
View File

@ -0,0 +1,30 @@
kind: pipeline
name: default
steps:
- name: test
image: gradle:jdk11
commands:
- gradle test
- name: build
image: gradle:jdk11
commands:
- gradle bootJar
when:
event:
- tag
- name: docker
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: mosadxyz/tcor
tags:
- latest
when:
event:
- tag

View File

@ -1,22 +0,0 @@
pipeline:
test:
image: gradle:jdk11
commands:
- gradle test
build:
image: gradle:jdk11
commands:
- gradle bootJar
when:
event:
- tag
docker:
image: plugins/docker
repo: mosadxyz/tcor
tags: latest
secrets:
- username: docker_username
password: docker_password
when:
event:
- tag

View File

@ -1,5 +1,5 @@
![Website](https://img.shields.io/website?down_color=red&down_message=offline&label=tcor.mosad.xyz&up_color=brightgreen&up_message=online&url=https%3A%2F%2Ftcor.mosad.xyz%2Fhealth)
[![Build Status](https://ci.mosad.xyz/api/badges/Seil0/TheCitadelofRicks/status.svg)](https://ci.mosad.xyz/Seil0/TheCitadelofRicks)
[![Build Status](https://drone.mosad.xyz/api/badges/Seil0/TheCitadelofRicks/status.svg)](https://drone.mosad.xyz/Seil0/TheCitadelofRicks)
[![Release](https://img.shields.io/badge/dynamic/json.svg?label=release&url=https://git.mosad.xyz/api/v1/repos/Seil0/TheCitadelofRicks/releases&query=$[0].tag_name)](https://git.mosad.xyz/Seil0/TheCitadelofRicks/releases)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
# TheCitadelofRicks

View File

@ -49,7 +49,7 @@ class APIController {
companion object {
const val apiVersion = "1.2.0"
const val softwareVersion = "1.2.8"
const val softwareVersion = "1.2.7"
val startTime = System.currentTimeMillis() / 1000
}

View File

@ -44,7 +44,7 @@ class StartupController {
var cachetAPIKey = "0"
var cachetBaseURL = "https://status.mosad.xyz"
var courseListURL = "https://www.hs-offenburg.de/studium/vorlesungsplaene/"
var mensaMenuURL = "https://www.swfr.de/essen-trinken/speiseplaene/mensa-offenburg/"
var mensaMenuURL = "https://www.swfr.de/de/essen-trinken/speiseplaene/mensa-offenburg/"
var mensaName = "Offenburg"
}
@ -92,7 +92,7 @@ class StartupController {
mensaMenuURL = try {
properties.getProperty("mensaMenuURL")
} catch (ex: Exception) {
"https://www.swfr.de/essen-trinken/speiseplaene/mensa-offenburg/"
"https://www.swfr.de/de/essen-trinken/speiseplaene/mensa-offenburg/"
}
mensaName = try {
@ -113,7 +113,7 @@ class StartupController {
properties.setProperty("cachetAPIKey", "0")
properties.setProperty("cachetBaseURL", "https://status.mosad.xyz")
properties.setProperty("mensaMenuURL", "https://www.swfr.de/essen-trinken/speiseplaene/mensa-offenburg/")
properties.setProperty("mensaMenuURL", "https://www.swfr.de/de/essen-trinken/speiseplaene/mensa-offenburg/")
properties.setProperty("mensaName", "Offenburg")
val outputStream = FileOutputStream(fileConfig)

View File

@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test
import java.io.File
internal class MensaParserTest {
private val mensaMenuURL = "https://www.swfr.de/essen-trinken/speiseplaene/mensa-offenburg/"
private val mensaMenuURL = "https://www.swfr.de/de/essen-trinken/speiseplaene/mensa-offenburg/"
@Test
fun parseMensaMenuNormalWeek() {

View File

@ -1,7 +1,7 @@
<div id="speiseplan-tabs">
<div id="tab-menu-container" class="row">
<div class="col-md-1 col-xs-6">
<a class="prev-week" title="eine Woche zurück" href="/essen-trinken/speiseplaene/mensa-offenburg/?tx_swfrspeiseplan_pi1%5BweekToShow%5D=0&amp;tx_swfrspeiseplan_pi1%5Baction%5D=show&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=ad074b11cc01a680e4c0d0675dd1f91c"><img src="/fileadmin/templates/images/keil-grau-links.png" width="16" height="16" alt="" /><span class="d-inline d-sm-none">vorherige Woche</span></a>
<a class="prev-week" title="eine Woche zurück" href="/de/essen-trinken/speiseplaene/mensa-offenburg/?tx_swfrspeiseplan_pi1%5BweekToShow%5D=0&amp;tx_swfrspeiseplan_pi1%5Baction%5D=show&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=ad074b11cc01a680e4c0d0675dd1f91c"><img src="/fileadmin/templates/images/keil-grau-links.png" width="16" height="16" alt="" /><span class="d-inline d-sm-none">vorherige Woche</span></a>
</div>
<div class="col-md-10">
<ul class="nav classic-tabs tabs-primary" role="tablist">
@ -13,7 +13,7 @@
<li class="col-md-2"><a href="#tab-sat" class="nav-link" data-toggle="tab" role="tab">Sa 14.03.</a></li>
</ul>
</div>
<div class="col-md-1 col-xs-6 pull-right"><a class="next-week text-right" title="eine Woche weiter" href="/essen-trinken/speiseplaene/mensa-offenburg/?tx_swfrspeiseplan_pi1%5BweekToShow%5D=2&amp;tx_swfrspeiseplan_pi1%5Baction%5D=show&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=3c3048ebdd7f42a104bd780a0a6a0fd1"><span class="d-inline d-sm-none">nächste Woche</span><img src="/fileadmin/templates/images/keil-grau-rechts.png" width="16" height="16" alt="" /></a></div>
<div class="col-md-1 col-xs-6 pull-right"><a class="next-week text-right" title="eine Woche weiter" href="/de/essen-trinken/speiseplaene/mensa-offenburg/?tx_swfrspeiseplan_pi1%5BweekToShow%5D=2&amp;tx_swfrspeiseplan_pi1%5Baction%5D=show&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=3c3048ebdd7f42a104bd780a0a6a0fd1"><span class="d-inline d-sm-none">nächste Woche</span><img src="/fileadmin/templates/images/keil-grau-rechts.png" width="16" height="16" alt="" /></a></div>
</div>
<div class="row">
<div class="col-sm-4">
@ -34,12 +34,12 @@
</div>
<div class="col-sm-4 pt-3">
<div class="hide-with-allergenes">
<p><a download="Mensa_Offenburg_KW_11-2020.pdf" title="Wochenplan in Farbe herunterladen" target="_blank" href="/essen-trinken/speiseplaene/mensa-offenburg/?type=99&amp;tx_swfrspeiseplan_pi1%5BweekToShow%5D=1&amp;tx_swfrspeiseplan_pi1%5Bcolored%5D=1&amp;tx_swfrspeiseplan_pi1%5Bort%5D=651&amp;tx_swfrspeiseplan_pi1%5Baction%5D=buildPdf&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=4de091579c564e42f79473da2701f179"><i class="fas fa-file-download" aria-hidden="true"></i> Wochenplan farbig</a></p>
<p><a download="Mensa_Offenburg_KW_11-2020.pdf" title="Wochenplan in schwarz-weiß herunterladen" target="_blank" href="/essen-trinken/speiseplaene/mensa-offenburg/?type=99&amp;tx_swfrspeiseplan_pi1%5BweekToShow%5D=1&amp;tx_swfrspeiseplan_pi1%5Bcolored%5D=0&amp;tx_swfrspeiseplan_pi1%5Bort%5D=651&amp;tx_swfrspeiseplan_pi1%5Baction%5D=buildPdf&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=84edf4562bdc95f103b70ef99e4d7af6"><i class="fas fa-file-download" aria-hidden="true"></i> Wochenplan s/w</a></p>
<p><a download="Mensa_Offenburg_KW_11-2020.pdf" title="Wochenplan in Farbe herunterladen" target="_blank" href="/de/essen-trinken/speiseplaene/mensa-offenburg/?type=99&amp;tx_swfrspeiseplan_pi1%5BweekToShow%5D=1&amp;tx_swfrspeiseplan_pi1%5Bcolored%5D=1&amp;tx_swfrspeiseplan_pi1%5Bort%5D=651&amp;tx_swfrspeiseplan_pi1%5Baction%5D=buildPdf&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=4de091579c564e42f79473da2701f179"><i class="fas fa-file-download" aria-hidden="true"></i> Wochenplan farbig</a></p>
<p><a download="Mensa_Offenburg_KW_11-2020.pdf" title="Wochenplan in schwarz-weiß herunterladen" target="_blank" href="/de/essen-trinken/speiseplaene/mensa-offenburg/?type=99&amp;tx_swfrspeiseplan_pi1%5BweekToShow%5D=1&amp;tx_swfrspeiseplan_pi1%5Bcolored%5D=0&amp;tx_swfrspeiseplan_pi1%5Bort%5D=651&amp;tx_swfrspeiseplan_pi1%5Baction%5D=buildPdf&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=84edf4562bdc95f103b70ef99e4d7af6"><i class="fas fa-file-download" aria-hidden="true"></i> Wochenplan s/w</a></p>
</div>
<div class="show-with-allergenes">
<p><a download="Mensa_Offenburg_KW_11-2020.pdf" title="Wochenplan in Farbe herunterladen" target="_blank" href="/essen-trinken/speiseplaene/mensa-offenburg/?type=99&amp;tx_swfrspeiseplan_pi1%5BweekToShow%5D=1&amp;tx_swfrspeiseplan_pi1%5Bcolored%5D=1&amp;tx_swfrspeiseplan_pi1%5Bort%5D=651&amp;tx_swfrspeiseplan_pi1%5Baction%5D=buildPdfAllergenes&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=51f0f1e0083f9ef48038920dfb676eb6"><i class="fas fa-file-download" aria-hidden="true"></i> Wochenplan farbig</a></p>
<p><a download="Mensa_Offenburg_KW_11-2020.pdf" title="Wochenplan in schwarz-weiß herunterladen" target="_blank" href="/essen-trinken/speiseplaene/mensa-offenburg/?type=99&amp;tx_swfrspeiseplan_pi1%5BweekToShow%5D=1&amp;tx_swfrspeiseplan_pi1%5Bcolored%5D=0&amp;tx_swfrspeiseplan_pi1%5Bort%5D=651&amp;tx_swfrspeiseplan_pi1%5Baction%5D=buildPdfAllergenes&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=c3a9d1eafce78d8f8d281c6060be989c"><i class="fas fa-file-download" aria-hidden="true"></i> Wochenplan s/w</a></p>
<p><a download="Mensa_Offenburg_KW_11-2020.pdf" title="Wochenplan in Farbe herunterladen" target="_blank" href="/de/essen-trinken/speiseplaene/mensa-offenburg/?type=99&amp;tx_swfrspeiseplan_pi1%5BweekToShow%5D=1&amp;tx_swfrspeiseplan_pi1%5Bcolored%5D=1&amp;tx_swfrspeiseplan_pi1%5Bort%5D=651&amp;tx_swfrspeiseplan_pi1%5Baction%5D=buildPdfAllergenes&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=51f0f1e0083f9ef48038920dfb676eb6"><i class="fas fa-file-download" aria-hidden="true"></i> Wochenplan farbig</a></p>
<p><a download="Mensa_Offenburg_KW_11-2020.pdf" title="Wochenplan in schwarz-weiß herunterladen" target="_blank" href="/de/essen-trinken/speiseplaene/mensa-offenburg/?type=99&amp;tx_swfrspeiseplan_pi1%5BweekToShow%5D=1&amp;tx_swfrspeiseplan_pi1%5Bcolored%5D=0&amp;tx_swfrspeiseplan_pi1%5Bort%5D=651&amp;tx_swfrspeiseplan_pi1%5Baction%5D=buildPdfAllergenes&amp;tx_swfrspeiseplan_pi1%5Bcontroller%5D=Speiseplan&amp;cHash=c3a9d1eafce78d8f8d281c6060be989c"><i class="fas fa-file-download" aria-hidden="true"></i> Wochenplan s/w</a></p>
</div>
</div>
<div class="col-sm-4 pt-3">