Compare commits

..

13 Commits

Author SHA1 Message Date
Hannes Braun 6f4cb9fd66
Small improvements
- Improve formatting
- Fix some typos
- Mini code improvements
2021-10-13 22:21:43 +02:00
Hannes Braun 1f1374f112
Make the update scheduling more readable (hopefully) 2021-10-13 22:21:43 +02:00
Hannes Braun b783fb6c4f
StatusController: use properties instead of getters 2021-10-13 22:21:42 +02:00
Hannes Braun 65dc8ea5d2
Also set JVM target to 11 for Java 2021-10-13 22:21:42 +02:00
Hannes Braun 97efbd0877
Dependency updates
This also replaces JCenter with Maven Central since JCenter is now read-only
2021-10-13 22:21:42 +02:00
Hannes Braun c62f576ace
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 22:21:42 +02:00
Hannes Braun 8ac78d29b1
Update Kotlin to 1.5.31 2021-10-13 22:21:41 +02:00
Jannik 024f2b04ce „README.md“ ändern
continuous-integration/drone the build was successful Details
2021-10-13 20:09:46 +02:00
Jannik bf71d62dc5
version 1.2.8
continuous-integration/drone the build failed Details
2021-10-13 20:03:14 +02:00
Jannik 7dce2c6cfd Merge pull request 'updated mensa URL' (#16) from fix/mensa_url into master
continuous-integration/drone the build was successful Details
Reviewed-on: #16
2021-10-13 19:49:53 +02:00
Hendrik Schutter a1dc5656b8
updated mensa URL, thanks to Hannes B.
continuous-integration/drone the build was successful Details
2021-10-13 19:47:38 +02:00
Jannik dd4c5259d2 Merge pull request 'move ci config from drone to woodpecker' (#18) from fix/ci into master
continuous-integration/drone the build failed Details
Reviewed-on: #18
2021-10-13 19:45:32 +02:00
Jannik 884aab08ed
move ci config from drone to woodpecker
continuous-integration/drone the build failed Details
2021-10-13 19:39:37 +02:00
7 changed files with 37 additions and 45 deletions

View File

@ -1,30 +0,0 @@
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

22
.woodpecker.yml Normal file
View File

@ -0,0 +1,22 @@
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://drone.mosad.xyz/api/badges/Seil0/TheCitadelofRicks/status.svg)](https://drone.mosad.xyz/Seil0/TheCitadelofRicks)
[![Build Status](https://ci.mosad.xyz/api/badges/Seil0/TheCitadelofRicks/status.svg)](https://ci.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.7"
const val softwareVersion = "1.2.8"
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/de/essen-trinken/speiseplaene/mensa-offenburg/"
var mensaMenuURL = "https://www.swfr.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/de/essen-trinken/speiseplaene/mensa-offenburg/"
"https://www.swfr.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/de/essen-trinken/speiseplaene/mensa-offenburg/")
properties.setProperty("mensaMenuURL", "https://www.swfr.de/essen-trinken/speiseplaene/mensa-offenburg/")
properties.setProperty("mensaName", "Offenburg")
val outputStream = FileOutputStream(fileConfig)
@ -146,4 +146,4 @@ class StartupController {
}
}
}
}
}

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/de/essen-trinken/speiseplaene/mensa-offenburg/"
private val mensaMenuURL = "https://www.swfr.de/essen-trinken/speiseplaene/mensa-offenburg/"
@Test
fun parseMensaMenuNormalWeek() {
@ -57,4 +57,4 @@ internal class MensaParserTest {
val urlNextWeek = MensaParser().getMenuLinkNextWeek(mensaMenuURL) // this need a connection to the swfr server
Assertions.assertNotNull(urlNextWeek)
}
}
}

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="/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>
<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>
</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="/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 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>
<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="/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>
<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>
</div>
<div class="show-with-allergenes">
<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>
<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>
</div>
</div>
<div class="col-sm-4 pt-3">
@ -510,4 +510,4 @@
</div>
</div>
</div>
</div>
</div>