Compare commits
78 Commits
98b9321c12
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dee4f34f60 | ||
| 95ea00dad5 | |||
| 245d535a55 | |||
|
|
476051409e | ||
| dc1ebb2b57 | |||
| b29e9a813b | |||
| 2233c91d8c | |||
| 7f2558155d | |||
| 00ea7e18e8 | |||
| 2c81d0cac3 | |||
| ece15b8648 | |||
| e0bfc47032 | |||
| c35d28951e | |||
| 9c060863f6 | |||
| c6f070bdab | |||
| dd62417977 | |||
|
|
f0c75e9e2b | ||
|
|
9506a9b370 | ||
|
|
01215cd5a8 | ||
|
|
284c5d82f8 | ||
| d8a6355587 | |||
| 1bad009063 | |||
|
|
f8a46c9ad6 | ||
| 32bc791bd0 | |||
| 38fba7b906 | |||
| 258ff19064 | |||
| a3882ab42b | |||
| 6f0eaf9355 | |||
| 71fbe558be | |||
| 1a83102652 | |||
| baffe58204 | |||
|
|
bed7c64189 | ||
|
|
a1fea88de6 | ||
|
|
091f8730d0 | ||
| a697ef0e88 | |||
| cf35b899a1 | |||
| dabedcfbb1 | |||
| 163b313649 | |||
| dd0f8128a6 | |||
| 57c9076c04 | |||
| db6f20c339 | |||
| 237d71c03d | |||
| 8a15e8d8a8 | |||
| 81e1142533 | |||
| 1236632a2a | |||
| 356742fb3a | |||
| adae524312 | |||
| b77d425f58 | |||
| 662850c35c | |||
| 0d5307cf1a | |||
| 1889be5b14 | |||
| 10b5cc2f9c | |||
| 420196509c | |||
| bbf7cdc9e8 | |||
| e591444955 | |||
| c96851459d | |||
|
|
b394fd0baf | ||
|
|
e9ed32bb26 | ||
|
|
67a0576e4d | ||
|
|
42c390e4ce | ||
| eb996dd004 | |||
|
|
f599aa1954 | ||
|
|
145aa5083c | ||
|
|
35e2fd44a5 | ||
|
|
ba68057c0f | ||
|
|
b411f5d57f | ||
|
|
29f00f39aa | ||
|
|
23cef6f545 | ||
| 2acc6acafe | |||
| cbc4b4ff76 | |||
| fbca245326 | |||
| 2514200eeb | |||
| 7c90434f0f | |||
| d2ed44cc9a | |||
| 04f0188c3f | |||
| a06efd5355 | |||
| 9cf286db39 | |||
| 4dcd994ac9 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@
|
||||
/target/
|
||||
src/main/main.iml
|
||||
src/test/test.iml
|
||||
bin
|
||||
56
.vscode/launch.json
vendored
Normal file
56
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "APIFootballUpdater",
|
||||
"request": "launch",
|
||||
"mainClass": "de.jeyp91.App",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"args": " --mode APIFootballUpdater --season 2026 --league 1 --configFile Tippliga"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "MatchesCreatorFootball",
|
||||
"request": "launch",
|
||||
"mainClass": "de.jeyp91.App",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"args": " --mode MatchesCreatorFootball --season 2026 --league 47 --configFile Relegation"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "MatchesUpdaterFootball",
|
||||
"request": "launch",
|
||||
"mainClass": "de.jeyp91.App",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"args": " --mode MatchesUpdaterFootball --season 2026 --league 48 --configFile WTL-Pokal"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "MatchdaysUpdater",
|
||||
"request": "launch",
|
||||
"mainClass": "de.jeyp91.App",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"args": " --mode MatchdaysUpdater --season 2026 --league 1 --configFile Tippliga"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "MatchesResultsUpdater",
|
||||
"request": "launch",
|
||||
"mainClass": "de.jeyp91.App",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"args": " --mode MatchesResultsUpdater --season 2026 --league 1 --configFile Tippliga"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "MatchesListGistUpdater",
|
||||
"request": "launch",
|
||||
"mainClass": "de.jeyp91.App",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"args": " --mode MatchesListGistUpdater --season 2026 --league 1 --configFile Tippliga"
|
||||
}
|
||||
]
|
||||
}
|
||||
36
build.gradle
36
build.gradle
@@ -2,12 +2,13 @@
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'application'
|
||||
plugins {
|
||||
id 'com.github.ben-manes.versions' version '0.52.0'
|
||||
id 'java'
|
||||
id 'application'
|
||||
}
|
||||
|
||||
mainClassName = 'App'
|
||||
sourceCompatibility = 11
|
||||
targetCompatibility = 11
|
||||
version = '1.0'
|
||||
compileJava.options.encoding = 'UTF-8'
|
||||
compileTestJava.options.encoding = 'UTF-8'
|
||||
@@ -18,23 +19,22 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'mysql:mysql-connector-java:8.0.32'
|
||||
implementation 'mysql:mysql-connector-java:8.0.33'
|
||||
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
|
||||
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
implementation platform('com.amazonaws:aws-java-sdk-bom:1.12.429')
|
||||
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.429'
|
||||
implementation 'com.google.auth:google-auth-library-oauth2-http:1.16.0'
|
||||
implementation 'com.google.api-client:google-api-client:2.2.0'
|
||||
implementation 'com.google.apis:google-api-services-calendar:v3-rev20220715-2.0.0'
|
||||
implementation 'com.google.guava:guava:31.1-jre'
|
||||
implementation 'commons-cli:commons-cli:1.5.0'
|
||||
implementation 'com.google.code.gson:gson:2.11.0'
|
||||
implementation 'com.google.auth:google-auth-library-oauth2-http:1.31.0'
|
||||
implementation 'com.google.api-client:google-api-client:2.7.2'
|
||||
implementation 'com.google.apis:google-api-services-calendar:v3-rev20250115-2.0.0'
|
||||
implementation 'com.google.guava:guava:33.4.0-jre'
|
||||
implementation 'commons-cli:commons-cli:1.9.0'
|
||||
implementation 'net.sourceforge.argparse4j:argparse4j:0.9.0'
|
||||
implementation 'org.apache.logging.log4j:log4j-api:2.20.0'
|
||||
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
|
||||
implementation 'javax.xml.bind:jaxb-api:2.3.1'
|
||||
implementation 'org.slf4j:slf4j-api:1.6.1'
|
||||
implementation 'org.slf4j:slf4j-simple:1.6.1'
|
||||
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
|
||||
implementation 'software.amazon.awssdk:s3:2.30.6'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
testImplementation 'org.testng:testng:7.7.0'
|
||||
testImplementation 'org.testng:testng:7.10.2'
|
||||
}
|
||||
|
||||
jar {
|
||||
@@ -50,4 +50,4 @@ jar {
|
||||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
}
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
}
|
||||
|
||||
2
gradle/gradle-daemon-jvm.properties
Normal file
2
gradle/gradle-daemon-jvm.properties
Normal file
@@ -0,0 +1,2 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainVersion=22
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
#Tue May 26 17:58:07 CEST 2020
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
|
||||
distributionUrl=https://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
25
jenkinsfiles/APIFootballUpdater/Jenkinsfile
vendored
25
jenkinsfiles/APIFootballUpdater/Jenkinsfile
vendored
@@ -10,17 +10,24 @@ pipeline {
|
||||
stage('Execute') {
|
||||
steps {
|
||||
script {
|
||||
String jdkPath = tool name: 'OpenJDK19', type: 'jdk'
|
||||
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
||||
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2","AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
||||
String jdkPath = tool name: 'OpenJDK22', type: 'jdk'
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
|
||||
usernamePassword(credentialsId: 'forum_database', usernameVariable: 'TLW_DATABASE_USERNAME', passwordVariable: 'TLW_DATABASE_PASSWORD'),
|
||||
usernamePassword(credentialsId: 'forum_user', usernameVariable: 'FORUM_USERNAME', passwordVariable: 'FORUM_PASSWORD')
|
||||
]) {
|
||||
withEnv([
|
||||
"JAVA_HOME=${jdkPath}/jdk-22.0.2"
|
||||
]) {
|
||||
try {
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode APIFootballUpdater --season ${season} --league 1 --configFile Tippliga 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesListGistUpdater --season ${season} --league 1 --configFile Tippliga 2>&1 >> log.txt"
|
||||
sh "java --version"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode APIFootballUpdater --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesListGistUpdater --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1"
|
||||
} catch (Exception e) {
|
||||
telegramSendManual("TLW-Database-Tool crashed!")
|
||||
}
|
||||
String output = readFile 'log.txt'
|
||||
if(output != "") {
|
||||
String outputString = readFile 'log.txt'
|
||||
if(outputString != "") {
|
||||
ArrayList<String> outputList = outputString.replace("\n\n", "\n").split('\n').toList()
|
||||
outputList = clean(outputList)
|
||||
outputList.each {
|
||||
@@ -34,8 +41,12 @@ pipeline {
|
||||
}
|
||||
stage('Trigger Tool') {
|
||||
steps {
|
||||
echo 'Trigger jobs'
|
||||
build wait: false, job: 'TippligaUpdater'
|
||||
build wait: false, job: 'WTLPokalUpdater'
|
||||
build wait: false, job: 'SupercupUpdater'
|
||||
// build wait: false, job: 'RelegationUpdater'
|
||||
// build wait: false, job: 'LigaCupUpdater'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
jenkinsfiles/CheckGistUpdates/Jenkinsfile
vendored
16
jenkinsfiles/CheckGistUpdates/Jenkinsfile
vendored
@@ -10,13 +10,19 @@ pipeline {
|
||||
stage('GetAndWriteChecksum') {
|
||||
steps {
|
||||
script {
|
||||
String jdkPath = tool name: 'OpenJDK19', type: 'jdk'
|
||||
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
||||
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2","AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
||||
String checksum_tippliga = sh returnStdout: true, script: "java -jar build/libs/tlw-database-tool-1.0.jar --mode PostChecksum --season ${season} --league 1 --configFile Tippliga 2>&1"
|
||||
String jdkPath = tool name: 'OpenJDK22', type: 'jdk'
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
|
||||
usernamePassword(credentialsId: 'forum_database', usernameVariable: 'TLW_DATABASE_USERNAME', passwordVariable: 'TLW_DATABASE_PASSWORD'),
|
||||
usernamePassword(credentialsId: 'forum_user', usernameVariable: 'FORUM_USERNAME', passwordVariable: 'FORUM_PASSWORD')
|
||||
]) {
|
||||
withEnv([
|
||||
"JAVA_HOME=${jdkPath}/jdk-22.0.2"
|
||||
]) {
|
||||
String checksum_tippliga = sh returnStdout: true, script: "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode PostChecksum --season ${season} --league 1 --configFile Tippliga 2>&1"
|
||||
writeFile file: 'checksum_tippliga.txt', text: checksum_tippliga
|
||||
archiveArtifacts artifacts: 'checksum_tippliga.txt', followSymlinks: false
|
||||
String checksum_wtlpokal = sh returnStdout: true, script: "java -jar build/libs/tlw-database-tool-1.0.jar --mode PostChecksum --season ${season} --league 1 --configFile WTL-Pokal 2>&1"
|
||||
String checksum_wtlpokal = sh returnStdout: true, script: "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode PostChecksum --season ${season} --league 1 --configFile WTL-Pokal 2>&1"
|
||||
writeFile file: 'checksum_wtlpokal.txt', text: checksum_wtlpokal
|
||||
archiveArtifacts artifacts: 'checksum_wtlpokal.txt', followSymlinks: false
|
||||
}
|
||||
|
||||
80
jenkinsfiles/LigaCupUpdater/Jenkinsfile
vendored
Normal file
80
jenkinsfiles/LigaCupUpdater/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Restore tlw-database-tool') {
|
||||
steps {
|
||||
copyArtifacts filter: '**/tlw-database-tool-1.0.jar', fingerprintArtifacts: true, projectName: 'build tlw-database-tool', selector: lastSuccessful(), target: '.'
|
||||
}
|
||||
}
|
||||
stage('Execute') {
|
||||
steps {
|
||||
script {
|
||||
String jdkPath = tool name: 'OpenJDK22', type: 'jdk'
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
|
||||
usernamePassword(credentialsId: 'forum_database', usernameVariable: 'TLW_DATABASE_USERNAME', passwordVariable: 'TLW_DATABASE_PASSWORD'),
|
||||
usernamePassword(credentialsId: 'forum_user', usernameVariable: 'FORUM_USERNAME', passwordVariable: 'FORUM_PASSWORD')
|
||||
]) {
|
||||
withEnv([
|
||||
"JAVA_HOME=${jdkPath}/jdk-22.0.2"
|
||||
]) {
|
||||
try {
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 49 --configFile EM-Tippspiel >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 49 --configFile EM-Tippspiel >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 49 --configFile EM-Tippspiel >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 49 --configFile EM-Tippspiel >> log.txt 2>&1"
|
||||
} catch (Exception e) {
|
||||
telegramSendManual("TLW-Database-Tool crashed!")
|
||||
}
|
||||
String outputString = readFile 'log.txt'
|
||||
if(outputString != "") {
|
||||
ArrayList<String> outputList = outputString.replace("\n\n", "\n").split('\n').toList()
|
||||
outputList = clean(outputList)
|
||||
outputList.each {
|
||||
telegramSendManual(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
telegramSendManual("Build failed!\n${env.BUILD_URL}console")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<String> clean(ArrayList<String> orig) {
|
||||
ArrayList<String> cleaned = new ArrayList<String>()
|
||||
orig.each{line ->
|
||||
if(line.indexOf(" [main] INFO de.jeyp91 - ") >= 0) {
|
||||
line = line.substring(20, line.size())
|
||||
}
|
||||
|
||||
if(line.indexOf(" [main] ERROR de.jeyp91") >= 0) {
|
||||
line = line.substring(20, line.size())
|
||||
}
|
||||
cleaned.add(line)
|
||||
}
|
||||
return cleaned.unique()
|
||||
}
|
||||
|
||||
def telegramSendManual(String text) {
|
||||
def encodedMessage = URLEncoder.encode(text, "UTF-8")
|
||||
println encodedMessage
|
||||
httpRequest(
|
||||
httpMode: 'GET',
|
||||
contentType: 'APPLICATION_JSON',
|
||||
responseHandle: 'NONE',
|
||||
url: "https://api.telegram.org/bot1298223079:AAEplcQpfzFG59qNYAYuSbJKtB9HMXCCE_U/sendMessage?text=$encodedMessage&chat_id=459231986&disable_web_page_preview=true",
|
||||
wrapAsMultipart: false,
|
||||
consoleLogResponseBody: true
|
||||
)
|
||||
}
|
||||
80
jenkinsfiles/RelegationUpdater/Jenkinsfile
vendored
Normal file
80
jenkinsfiles/RelegationUpdater/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Restore tlw-database-tool') {
|
||||
steps {
|
||||
copyArtifacts filter: '**/tlw-database-tool-1.0.jar', fingerprintArtifacts: true, projectName: 'build tlw-database-tool', selector: lastSuccessful(), target: '.'
|
||||
}
|
||||
}
|
||||
stage('Execute') {
|
||||
steps {
|
||||
script {
|
||||
String jdkPath = tool name: 'OpenJDK22', type: 'jdk'
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
|
||||
usernamePassword(credentialsId: 'forum_database', usernameVariable: 'TLW_DATABASE_USERNAME', passwordVariable: 'TLW_DATABASE_PASSWORD'),
|
||||
usernamePassword(credentialsId: 'forum_user', usernameVariable: 'FORUM_USERNAME', passwordVariable: 'FORUM_PASSWORD')
|
||||
]) {
|
||||
withEnv([
|
||||
"JAVA_HOME=${jdkPath}/jdk-22.0.2"
|
||||
]) {
|
||||
try {
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 47 --configFile Relegation >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 47 --configFile Relegation >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 47 --configFile Relegation >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 47 --configFile Relegation >> log.txt 2>&1"
|
||||
} catch (Exception e) {
|
||||
telegramSendManual("TLW-Database-Tool crashed!")
|
||||
}
|
||||
String outputString = readFile 'log.txt'
|
||||
if(outputString != "") {
|
||||
ArrayList<String> outputList = outputString.replace("\n\n", "\n").split('\n').toList()
|
||||
outputList = clean(outputList)
|
||||
outputList.each {
|
||||
telegramSendManual(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
telegramSendManual("Build failed!\n${env.BUILD_URL}console")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<String> clean(ArrayList<String> orig) {
|
||||
ArrayList<String> cleaned = new ArrayList<String>()
|
||||
orig.each{line ->
|
||||
if(line.indexOf(" [main] INFO de.jeyp91 - ") >= 0) {
|
||||
line = line.substring(20, line.size())
|
||||
}
|
||||
|
||||
if(line.indexOf(" [main] ERROR de.jeyp91") >= 0) {
|
||||
line = line.substring(20, line.size())
|
||||
}
|
||||
cleaned.add(line)
|
||||
}
|
||||
return cleaned.unique()
|
||||
}
|
||||
|
||||
def telegramSendManual(String text) {
|
||||
def encodedMessage = URLEncoder.encode(text, "UTF-8")
|
||||
println encodedMessage
|
||||
httpRequest(
|
||||
httpMode: 'GET',
|
||||
contentType: 'APPLICATION_JSON',
|
||||
responseHandle: 'NONE',
|
||||
url: "https://api.telegram.org/bot1298223079:AAEplcQpfzFG59qNYAYuSbJKtB9HMXCCE_U/sendMessage?text=$encodedMessage&chat_id=459231986&disable_web_page_preview=true",
|
||||
wrapAsMultipart: false,
|
||||
consoleLogResponseBody: true
|
||||
)
|
||||
}
|
||||
19
jenkinsfiles/SupercupUpdater/Jenkinsfile
vendored
19
jenkinsfiles/SupercupUpdater/Jenkinsfile
vendored
@@ -10,13 +10,20 @@ pipeline {
|
||||
stage('Execute') {
|
||||
steps {
|
||||
script {
|
||||
String jdkPath = tool name: 'OpenJDK', type: 'jdk'
|
||||
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
||||
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2","AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
||||
String jdkPath = tool name: 'OpenJDK22', type: 'jdk'
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
|
||||
usernamePassword(credentialsId: 'forum_database', usernameVariable: 'TLW_DATABASE_USERNAME', passwordVariable: 'TLW_DATABASE_PASSWORD'),
|
||||
usernamePassword(credentialsId: 'forum_user', usernameVariable: 'FORUM_USERNAME', passwordVariable: 'FORUM_PASSWORD')
|
||||
]) {
|
||||
withEnv([
|
||||
"JAVA_HOME=${jdkPath}/jdk-22.0.2"
|
||||
]) {
|
||||
try {
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 45 --configFile Supercup 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 45 --configFile Supercup 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 45 --configFile Supercup 2>&1 >> log.txt"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 45 --configFile Supercup >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 45 --configFile Supercup >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 45 --configFile Supercup >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 45 --configFile Supercup >> log.txt 2>&1"
|
||||
} catch (Exception e) {
|
||||
telegramSendManual("TLW-Database-Tool crashed!")
|
||||
}
|
||||
|
||||
28
jenkinsfiles/TippligaUpdater/Jenkinsfile
vendored
28
jenkinsfiles/TippligaUpdater/Jenkinsfile
vendored
@@ -10,21 +10,29 @@ pipeline {
|
||||
stage('Execute') {
|
||||
steps {
|
||||
script {
|
||||
String jdkPath = tool name: 'OpenJDK19', type: 'jdk'
|
||||
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
||||
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2", "AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
||||
String jdkPath = tool name: 'OpenJDK22', type: 'jdk'
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
|
||||
usernamePassword(credentialsId: 'forum_database', usernameVariable: 'TLW_DATABASE_USERNAME', passwordVariable: 'TLW_DATABASE_PASSWORD'),
|
||||
usernamePassword(credentialsId: 'forum_user', usernameVariable: 'FORUM_USERNAME', passwordVariable: 'FORUM_PASSWORD')
|
||||
]) {
|
||||
withEnv([
|
||||
"JAVA_HOME=${jdkPath}/jdk-22.0.2"
|
||||
]) {
|
||||
try {
|
||||
sh "ls build/libs"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 1 --configFile Tippliga 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 1 --configFile Tippliga 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 1 --configFile Tippliga 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 2 --configFile Tippliga 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 2 --configFile Tippliga 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 2 --configFile Tippliga 2>&1 >> log.txt"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 2 --configFile Tippliga >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 2 --configFile Tippliga >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 2 --configFile Tippliga >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 2 --configFile Tippliga >> log.txt 2>&1"
|
||||
} catch (Exception e) {
|
||||
telegramSendManual("TLW-Database-Tool crashed!")
|
||||
}
|
||||
String outputString = readFile 'log.txt'
|
||||
echo "Output: ${outputString}"
|
||||
if(outputString != "") {
|
||||
ArrayList<String> outputList = outputString.replace("\n\n", "\n").split('\n').toList()
|
||||
outputList = clean(outputList)
|
||||
|
||||
19
jenkinsfiles/WTLPokalUpdater/Jenkinsfile
vendored
19
jenkinsfiles/WTLPokalUpdater/Jenkinsfile
vendored
@@ -10,13 +10,20 @@ pipeline {
|
||||
stage('Execute') {
|
||||
steps {
|
||||
script {
|
||||
String jdkPath = tool name: 'OpenJDK19', type: 'jdk'
|
||||
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
||||
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2","AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
||||
String jdkPath = tool name: 'OpenJDK22', type: 'jdk'
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
|
||||
usernamePassword(credentialsId: 'forum_database', usernameVariable: 'TLW_DATABASE_USERNAME', passwordVariable: 'TLW_DATABASE_PASSWORD'),
|
||||
usernamePassword(credentialsId: 'forum_user', usernameVariable: 'FORUM_USERNAME', passwordVariable: 'FORUM_PASSWORD')
|
||||
]) {
|
||||
withEnv([
|
||||
"JAVA_HOME=${jdkPath}/jdk-22.0.2"
|
||||
]) {
|
||||
try {
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 48 --configFile WTL-Pokal 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 48 --configFile WTL-Pokal 2>&1 >> log.txt"
|
||||
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 48 --configFile WTL-Pokal 2>&1 >> log.txt"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 48 --configFile WTL-Pokal >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 48 --configFile WTL-Pokal >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 48 --configFile WTL-Pokal >> log.txt 2>&1"
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 48 --configFile WTL-Pokal >> log.txt 2>&1"
|
||||
} catch (Exception e) {
|
||||
telegramSendManual("TLW-Database-Tool crashed!")
|
||||
}
|
||||
|
||||
83
jenkinsfiles/WhatsAppReminder/Jenkinsfile
vendored
Normal file
83
jenkinsfiles/WhatsAppReminder/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Restore tlw-database-tool') {
|
||||
steps {
|
||||
copyArtifacts filter: '**/tlw-database-tool-1.0.jar', fingerprintArtifacts: true, projectName: 'build tlw-database-tool', selector: lastSuccessful(), target: '.'
|
||||
}
|
||||
}
|
||||
stage('Execute') {
|
||||
steps {
|
||||
script {
|
||||
String jdkPath = tool name: 'OpenJDK22', type: 'jdk'
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
|
||||
usernamePassword(credentialsId: 'forum_database', usernameVariable: 'TLW_DATABASE_USERNAME', passwordVariable: 'TLW_DATABASE_PASSWORD'),
|
||||
usernamePassword(credentialsId: 'forum_user', usernameVariable: 'FORUM_USERNAME', passwordVariable: 'FORUM_PASSWORD'),
|
||||
string(credentialsId: 'WhatsApp_Token', variable: 'TLW_WHATSAPP_API_KEY'),
|
||||
string(credentialsId: 'OPENAI_TOKEN', variable: 'OPENAI_TOKEN')
|
||||
]) {
|
||||
withEnv([
|
||||
"JAVA_HOME=${jdkPath}/jdk-22.0.2",
|
||||
"TLW_WHATSAPP_HOST=https://tlw-whatsapp.codeam.io"
|
||||
]) {
|
||||
try {
|
||||
sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode WhatsAppNotifier --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1"
|
||||
} catch (Exception e) {
|
||||
telegramSendManual("TLW-Database-Tool crashed!")
|
||||
}
|
||||
String outputString = readFile 'log.txt'
|
||||
if(outputString != "") {
|
||||
ArrayList<String> outputList = outputString.replace("\n\n", "\n").split('\n').toList()
|
||||
outputList = clean(outputList)
|
||||
outputList.each {
|
||||
telegramSendManual(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
telegramSendManual("Build failed!\n${env.BUILD_URL}console")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<String> clean(ArrayList<String> orig) {
|
||||
ArrayList<String> cleaned = new ArrayList<String>()
|
||||
orig.each{line ->
|
||||
if(line.indexOf(" [main] INFO de.jeyp91 - ") >= 0) {
|
||||
line = line.substring(20, line.size())
|
||||
}
|
||||
|
||||
if(line.indexOf(" [main] ERROR de.jeyp91") >= 0) {
|
||||
line = line.substring(20, line.size())
|
||||
}
|
||||
cleaned.add(line)
|
||||
}
|
||||
return cleaned.unique()
|
||||
}
|
||||
|
||||
def telegramSendManual(String text) {
|
||||
sleep 1
|
||||
if(text) {
|
||||
def encodedMessage = URLEncoder.encode(text, "UTF-8")
|
||||
println encodedMessage
|
||||
httpRequest(
|
||||
httpMode: 'GET',
|
||||
contentType: 'APPLICATION_JSON',
|
||||
responseHandle: 'NONE',
|
||||
url: "https://api.telegram.org/bot1298223079:AAEplcQpfzFG59qNYAYuSbJKtB9HMXCCE_U/sendMessage?text=$encodedMessage&chat_id=459231986&disable_web_page_preview=true",
|
||||
wrapAsMultipart: false,
|
||||
consoleLogResponseBody: true
|
||||
)
|
||||
}
|
||||
}
|
||||
16
jenkinsfiles/build/Jenkinsfile
vendored
16
jenkinsfiles/build/Jenkinsfile
vendored
@@ -10,9 +10,15 @@ pipeline {
|
||||
stage('Build') {
|
||||
steps {
|
||||
script {
|
||||
String jdkPath = tool name: 'OpenJDK19', type: 'jdk'
|
||||
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
||||
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2", "AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
||||
String jdkPath = tool name: 'OpenJDK22', type: 'jdk'
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: 'aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
|
||||
usernamePassword(credentialsId: 'forum_database', usernameVariable: 'TLW_DATABASE_USERNAME', passwordVariable: 'TLW_DATABASE_PASSWORD'),
|
||||
usernamePassword(credentialsId: 'forum_user', usernameVariable: 'FORUM_USERNAME', passwordVariable: 'FORUM_PASSWORD')
|
||||
]) {
|
||||
withEnv([
|
||||
"JAVA_HOME=${jdkPath}/jdk-22.0.2"
|
||||
]) {
|
||||
sh returnStdout: false, script: "./gradlew build -x test"
|
||||
}
|
||||
}
|
||||
@@ -26,8 +32,12 @@ pipeline {
|
||||
}
|
||||
stage('Trigger') {
|
||||
steps {
|
||||
echo 'Trigger jobs'
|
||||
build wait: false, job: 'TippligaUpdater'
|
||||
build wait: false, job: 'WTLPokalUpdater'
|
||||
build wait: false, job: 'SupercupUpdater'
|
||||
// build wait: false, job: 'RelegationUpdater'
|
||||
// build wait: false, job: 'LigaCupUpdater'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package de.jeyp91;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import de.jeyp91.apifootball.APIFootballUpdater;
|
||||
import de.jeyp91.googlecalendar.TippligaGoogleEventManager;
|
||||
import de.jeyp91.tippliga.TLWMatchdaysUpdater;
|
||||
import de.jeyp91.tippliga.TLWMatchesCreatorFootball;
|
||||
import de.jeyp91.tippliga.TLWMatchesResultsUpdater;
|
||||
import de.jeyp91.tippliga.TLWMatchesUpdaterFootball;
|
||||
import de.jeyp91.tippliga.TLWTeamsUpdater;
|
||||
import de.jeyp91.tippligaforum.MatchesListForumUpdater;
|
||||
import de.jeyp91.tippliga.*;
|
||||
import de.jeyp91.tippligaforum.TippligaConfigProvider;
|
||||
import de.jeyp91.tippligaforum.TippligaSQLConnector;
|
||||
import de.jeyp91.whatsapp.WhatsAppNotifier;
|
||||
import net.sourceforge.argparse4j.ArgumentParsers;
|
||||
import net.sourceforge.argparse4j.inf.ArgumentParser;
|
||||
import net.sourceforge.argparse4j.inf.ArgumentParserException;
|
||||
import net.sourceforge.argparse4j.inf.Namespace;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.core.config.Configurator;
|
||||
import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilder;
|
||||
import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilderFactory;
|
||||
import org.apache.logging.log4j.core.config.builder.api.RootLoggerComponentBuilder;
|
||||
import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
@@ -28,63 +28,65 @@ public class App {
|
||||
private static int season;
|
||||
private static int league;
|
||||
private static String configFile;
|
||||
private static final Logger logger = LogManager.getLogger(App.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(App.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
ConfigurationBuilder<BuiltConfiguration> builder
|
||||
= ConfigurationBuilderFactory.newConfigurationBuilder();
|
||||
|
||||
RootLoggerComponentBuilder rootLogger
|
||||
= builder.newRootLogger(Level.ERROR);
|
||||
|
||||
builder.add(rootLogger);
|
||||
Configurator.initialize(builder.build());
|
||||
Configurator.setRootLevel(Level.INFO);
|
||||
// SLF4J does not require explicit configuration here
|
||||
// Configuration can be done via an external configuration file (e.g., logback.xml)
|
||||
initOptions(args);
|
||||
String sql = "";
|
||||
String beautifulInfo = "";
|
||||
switch(mode) {
|
||||
case "MatchdaysUpdater":
|
||||
switch (mode) {
|
||||
case "MatchdaysUpdater" -> {
|
||||
TLWMatchdaysUpdater matchdaysUpdater = new TLWMatchdaysUpdater(season, league, configFile);
|
||||
sql = matchdaysUpdater.getUpdateSql();
|
||||
beautifulInfo = matchdaysUpdater.getBeautifulInfo();
|
||||
matchdaysUpdater.updateGoogleCalendar();
|
||||
break;
|
||||
case "MatchesCreatorFootball":
|
||||
}
|
||||
case "MatchesCreatorFootball" -> {
|
||||
TLWMatchesCreatorFootball creator = new TLWMatchesCreatorFootball(season, league, configFile);
|
||||
sql = creator.getSQLInsertString();
|
||||
break;
|
||||
case "MatchesUpdaterFootball":
|
||||
}
|
||||
case "MatchesUpdaterFootball" -> {
|
||||
TLWMatchesUpdaterFootball tlwMatchesUpdaterFootball = new TLWMatchesUpdaterFootball(season, league, configFile);
|
||||
sql = tlwMatchesUpdaterFootball.getUpdateSQL();
|
||||
beautifulInfo = tlwMatchesUpdaterFootball.getBeautifulInfo();
|
||||
break;
|
||||
case "TeamsUpdater":
|
||||
}
|
||||
case "MatchesResultsUpdater" -> {
|
||||
TLWMatchesResultsUpdater tlwMatchesResultsUpdater = new TLWMatchesResultsUpdater(season, league, configFile);
|
||||
beautifulInfo = tlwMatchesResultsUpdater.getBeautifulInfo();
|
||||
}
|
||||
case "TeamsUpdater" -> {
|
||||
TLWTeamsUpdater teamsUpdater = new TLWTeamsUpdater(season, league, configFile);
|
||||
sql = teamsUpdater.getInsertSQL();
|
||||
break;
|
||||
case "APIFootballUpdater":
|
||||
}
|
||||
case "APIFootballUpdater" -> {
|
||||
APIFootballUpdater apiFootballUpdater = new APIFootballUpdater();
|
||||
apiFootballUpdater.updateAllFixtures(season);
|
||||
apiFootballUpdater.updateAllRounds(season);
|
||||
break;
|
||||
case "MatchesListGistUpdater":
|
||||
MatchesListForumUpdater matchesListForumUpdater = new MatchesListForumUpdater(season);
|
||||
}
|
||||
case "MatchesListGistUpdater" -> {
|
||||
MatchesListForumUpdater matchesListForumUpdater = new MatchesListForumUpdater();
|
||||
matchesListForumUpdater.updateAllLeagues(season);
|
||||
break;
|
||||
case "PostChecksum":
|
||||
}
|
||||
case "PostChecksum" -> {
|
||||
TippligaConfigProvider configProvider = new TippligaConfigProvider(season);
|
||||
String checksum = configProvider.getChecksumOfConfigPost(configFile);
|
||||
System.out.println(checksum);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case "WhatsAppNotifier" -> {
|
||||
WhatsAppNotifier notifier = new WhatsAppNotifier();
|
||||
notifier.sendNotifications();
|
||||
}
|
||||
default -> {
|
||||
}
|
||||
}
|
||||
if(!StatusHolder.getError() && !sql.equals("")) {
|
||||
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
||||
con.executeUpdate(sql);
|
||||
logger.info(beautifulInfo);
|
||||
}
|
||||
if(!StatusHolder.getError() && !beautifulInfo.equals(""))
|
||||
logger.info(beautifulInfo);
|
||||
}
|
||||
|
||||
private static void initOptions(String[] args) {
|
||||
@@ -94,7 +96,7 @@ public class App {
|
||||
|
||||
parser.addArgument("-m", "--mode")
|
||||
.dest("mode")
|
||||
.choices("MatchdaysUpdater", "MatchesCreatorFootball", "MatchesUpdaterFootball", "TeamsUpdater", "APIFootballUpdater", "MatchesListGistUpdater", "PostChecksum")
|
||||
.choices("MatchdaysUpdater", "MatchesCreatorFootball", "MatchesUpdaterFootball", "MatchesResultsUpdater", "TeamsUpdater", "APIFootballUpdater", "MatchesListGistUpdater", "PostChecksum", "WhatsAppNotifier")
|
||||
.help("")
|
||||
.required(true)
|
||||
.type(String.class);
|
||||
|
||||
@@ -2,10 +2,18 @@ package de.jeyp91;
|
||||
|
||||
public abstract class BaseMatch {
|
||||
|
||||
public final Integer COMPARISON_IDENTICAL = 0;
|
||||
public final Integer COMPARISON_DIFFERENT = 1;
|
||||
public final Integer COMPARISON_DIFFERENT_DATETIME = 2;
|
||||
public final Integer COMPARISON_DIFFERENT_RESULT = 3;
|
||||
public static final Integer STATUS_NOTSTARTED = 0;
|
||||
public static final Integer STATUS_STARTED = 1;
|
||||
public static final Integer STATUS_PROVISIONAL_RESULT_AVAILABLE = 2;
|
||||
public static final Integer STATUS_FINISHED = 3;
|
||||
public static final Integer STATUS_NOT_EVALUATED = 4;
|
||||
|
||||
public enum COMPARISON {
|
||||
IDENTICAL,
|
||||
DIFFERENT,
|
||||
DIFFERENT_DATETIME,
|
||||
DIFFERENT_RESULT
|
||||
}
|
||||
|
||||
protected Integer teamIdHome;
|
||||
protected Integer teamIdGuest;
|
||||
@@ -15,8 +23,14 @@ public abstract class BaseMatch {
|
||||
protected Integer goalsGuest = null;
|
||||
protected Integer goalsOvertimeHome = null;
|
||||
protected Integer goalsOvertimeGuest = null;
|
||||
protected Integer goalsPenaltyHome = null;
|
||||
protected Integer goalsPenaltyGuest = null;
|
||||
protected Integer matchday = null;
|
||||
protected String matchDatetime = null;
|
||||
protected Integer status = null;
|
||||
protected Integer koMatch = 0;
|
||||
protected Integer showTable = 0;
|
||||
protected COMPARISON updateStatus = COMPARISON.IDENTICAL;
|
||||
|
||||
public Integer getMatchday() {
|
||||
return this.matchday;
|
||||
@@ -50,6 +64,14 @@ public abstract class BaseMatch {
|
||||
return this.goalsOvertimeGuest;
|
||||
}
|
||||
|
||||
public Integer getGoalsPenaltyHome() {
|
||||
return this.goalsPenaltyHome;
|
||||
}
|
||||
|
||||
public Integer getGoalsPenaltyGuest() {
|
||||
return this.goalsPenaltyGuest;
|
||||
}
|
||||
|
||||
public String getTeamNameHome() {
|
||||
return this.teamNameHome;
|
||||
}
|
||||
@@ -57,4 +79,34 @@ public abstract class BaseMatch {
|
||||
public String getTeamNameGuest() {
|
||||
return this.teamNameGuest;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public Integer getShowTable() {
|
||||
return this.showTable;
|
||||
}
|
||||
|
||||
public void setShowTable(boolean showTable) {
|
||||
this.showTable = showTable ? 0 : 1;
|
||||
}
|
||||
|
||||
public Boolean getKoMatch() {
|
||||
return this.koMatch == 1;
|
||||
}
|
||||
|
||||
public void setKoMatch(Boolean koMatch) {
|
||||
this.koMatch = koMatch ? 0 : 1;
|
||||
}
|
||||
|
||||
public void setUpdateStatus(COMPARISON newStatus) { this.updateStatus = newStatus; }
|
||||
|
||||
public COMPARISON getUpdateStatus() {
|
||||
return this.updateStatus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ public class ResourceProvider {
|
||||
return array;
|
||||
}
|
||||
|
||||
public static JSONArray getLigenConfig(int season) {
|
||||
return getJSONArrayFromResource("Tippliga/" + season + "_Ligen.json");
|
||||
public static JSONArray getLigenConfig() {
|
||||
return getJSONArrayFromResource("Tippliga/Ligen_v3.json");
|
||||
}
|
||||
|
||||
public static JSONArray getTeamIDMatcherConfig() {
|
||||
|
||||
@@ -1,95 +1,110 @@
|
||||
package de.jeyp91;
|
||||
|
||||
import com.amazonaws.AmazonServiceException;
|
||||
import com.amazonaws.SdkClientException;
|
||||
import com.amazonaws.regions.Regions;
|
||||
import com.amazonaws.services.s3.AmazonS3;
|
||||
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
|
||||
import com.amazonaws.services.s3.model.S3Object;
|
||||
import com.amazonaws.services.s3.model.S3ObjectInputStream;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider;
|
||||
import software.amazon.awssdk.core.exception.SdkClientException;
|
||||
import software.amazon.awssdk.core.sync.RequestBody;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.s3.S3Client;
|
||||
import software.amazon.awssdk.services.s3.model.GetObjectRequest;
|
||||
import software.amazon.awssdk.services.s3.model.NoSuchKeyException;
|
||||
import software.amazon.awssdk.services.s3.model.PutObjectRequest;
|
||||
import software.amazon.awssdk.services.s3.model.S3Exception;
|
||||
|
||||
public class S3Provider {
|
||||
private static final Regions AWS_DEFAULT_REGION = Regions.EU_CENTRAL_1;
|
||||
private static final Region AWS_DEFAULT_REGION = Region.EU_CENTRAL_1;
|
||||
private static final String BUCKET_NAME = "tlw-database-tool-api-football-data";
|
||||
private final S3Client s3;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(S3Provider.class);
|
||||
|
||||
public S3Provider() {
|
||||
s3 = S3Client.builder()
|
||||
.region(AWS_DEFAULT_REGION)
|
||||
.credentialsProvider(EnvironmentVariableCredentialsProvider.create())
|
||||
.build();
|
||||
}
|
||||
|
||||
private void writeToS3(String filename, String content) {
|
||||
final AmazonS3 s3 = AmazonS3ClientBuilder
|
||||
.standard()
|
||||
.withRegion(AWS_DEFAULT_REGION)
|
||||
.build();
|
||||
try {
|
||||
s3.putObject(BUCKET_NAME, filename, content);
|
||||
} catch (AmazonServiceException e) {
|
||||
System.err.println(e.getErrorMessage());
|
||||
this.s3.putObject(
|
||||
PutObjectRequest.builder()
|
||||
.bucket(BUCKET_NAME)
|
||||
.key(filename)
|
||||
.build(),
|
||||
RequestBody.fromString(content)
|
||||
);
|
||||
} catch (S3Exception e) {
|
||||
System.err.println(e.awsErrorDetails().errorMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void writeFixturesToS3(int league, String content) {
|
||||
writeToS3("fixtures/" + league + ".json", content);
|
||||
public void writeFixturesToS3(int season, int league, String content) {
|
||||
writeToS3(v3Filepath("fixtures", season, league), content);
|
||||
}
|
||||
|
||||
public void writeRoundsToS3(int league, String content) {
|
||||
writeToS3("rounds/" + league + ".json", content);
|
||||
public void writeRoundsToS3(int season, int league, String content) {
|
||||
writeToS3(v3Filepath("rounds", season, league), content);
|
||||
}
|
||||
|
||||
private String getFileFromS3(String filename) {
|
||||
final AmazonS3 s3 = AmazonS3ClientBuilder
|
||||
.standard()
|
||||
.withRegion(AWS_DEFAULT_REGION)
|
||||
.build();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
try {
|
||||
S3Object o = s3.getObject(BUCKET_NAME, filename);
|
||||
S3ObjectInputStream s3is = o.getObjectContent();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(s3is));
|
||||
GetObjectRequest getObjectRequest = GetObjectRequest.builder()
|
||||
.bucket(BUCKET_NAME)
|
||||
.key(filename)
|
||||
.build();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||
this.s3.getObject(getObjectRequest), StandardCharsets.UTF_8));
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
builder.append(line);
|
||||
}
|
||||
} catch (SdkClientException | IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchKeyException e) {
|
||||
logger.error(filename + " not found in S3.");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
String getFixturesStringFromS3(int league) {
|
||||
return getFileFromS3("fixtures/" + league + ".json");
|
||||
public JSONObject getFixturesJSONFromS3(int season, int league) {
|
||||
return stringToJSONObject(getFileFromS3(v3Filepath("fixtures", season, league)));
|
||||
}
|
||||
|
||||
public JSONObject getFixturesJSONFromS3(int league) {
|
||||
String fixturesString = getFixturesStringFromS3(league);
|
||||
public JSONObject getRoundsJSONFromS3(int season, int league) {
|
||||
return stringToJSONObject(getFileFromS3(v3Filepath("rounds", season, league)));
|
||||
}
|
||||
|
||||
private JSONObject stringToJSONObject(String rawData) {
|
||||
if(rawData.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
JSONParser parser = new JSONParser();
|
||||
JSONObject jsonObject = null;
|
||||
JSONObject data = null;
|
||||
try {
|
||||
jsonObject = (JSONObject) parser.parse(fixturesString);
|
||||
data = (JSONObject) parser.parse(rawData);
|
||||
} catch (ParseException e) {
|
||||
/* TODO */
|
||||
e.printStackTrace();
|
||||
}
|
||||
return jsonObject;
|
||||
return data;
|
||||
}
|
||||
|
||||
private String getRoundsStringFromS3(int league) {
|
||||
return getFileFromS3("rounds/" + league + ".json");
|
||||
}
|
||||
|
||||
public JSONObject getRoundsJSONFromS3(int league) {
|
||||
String fixturesString = getRoundsStringFromS3(league);
|
||||
JSONParser parser = new JSONParser();
|
||||
JSONObject jsonObject = null;
|
||||
try {
|
||||
jsonObject = (JSONObject) parser.parse(fixturesString);
|
||||
} catch (ParseException e) {
|
||||
/* TODO */
|
||||
e.printStackTrace();
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
private String v3Filepath (String prefix, int season, int league) {
|
||||
return "v3/" + prefix + "_" + season + "_" + league + ".json";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package de.jeyp91.apifootball;
|
||||
|
||||
import de.jeyp91.S3Provider;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import de.jeyp91.S3Provider;
|
||||
|
||||
public class APIFootballConnector {
|
||||
|
||||
@@ -16,7 +17,7 @@ public class APIFootballConnector {
|
||||
private final int season;
|
||||
private final HashMap<Integer, JSONObject> rounds = new HashMap<>();
|
||||
private final HashMap<Integer, JSONObject> matches = new HashMap<>();
|
||||
private static final Logger logger = LogManager.getLogger(APIFootballConnector.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(APIFootballConnector.class);
|
||||
|
||||
private APIFootballConnector(int season) {
|
||||
this.season = season;
|
||||
@@ -33,7 +34,7 @@ public class APIFootballConnector {
|
||||
|
||||
APIFootballMatch matchWithID = null;
|
||||
|
||||
ArrayList<APIFootballMatch> allMatches = getMatchesFromLeagueFromFile(league);
|
||||
ArrayList<APIFootballMatch> allMatches = getMatchesFromLeagueFromFile(this.season, league);
|
||||
for (APIFootballMatch singleMatch : allMatches) {
|
||||
if (singleMatch.getAPIFootBallMatchID() == id) {
|
||||
matchWithID = singleMatch;
|
||||
@@ -48,7 +49,7 @@ public class APIFootballConnector {
|
||||
|
||||
ArrayList<APIFootballMatch> matchesOfMatchday = new ArrayList<>();
|
||||
|
||||
ArrayList<APIFootballMatch> allMatches = getMatchesFromLeagueFromFile(league);
|
||||
ArrayList<APIFootballMatch> allMatches = getMatchesFromLeagueFromFile(this.season, league);
|
||||
for (APIFootballMatch singleMatch : allMatches) {
|
||||
if (singleMatch.getMatchday() == matchday) {
|
||||
matchesOfMatchday.add(singleMatch);
|
||||
@@ -58,15 +59,15 @@ public class APIFootballConnector {
|
||||
return matchesOfMatchday;
|
||||
}
|
||||
|
||||
public ArrayList<APIFootballMatch> getMatchesFromLeagueFromFile(int leagueId) {
|
||||
public ArrayList<APIFootballMatch> getMatchesFromLeagueFromFile(int season, int leagueId) {
|
||||
ArrayList<APIFootballMatch> matchesList = new ArrayList<>();
|
||||
S3Provider prov = new S3Provider();
|
||||
|
||||
if(!this.matches.containsKey(leagueId)) {
|
||||
this.matches.put(leagueId, prov.getFixturesJSONFromS3(leagueId));
|
||||
this.matches.put(leagueId, prov.getFixturesJSONFromS3(season, leagueId));
|
||||
}
|
||||
JSONObject matches = this.matches.get(leagueId);
|
||||
JSONArray matchArray = (JSONArray) (((JSONObject)matches.get("api")).get("fixtures"));
|
||||
JSONObject matchesObject = this.matches.get(leagueId);
|
||||
JSONArray matchArray = (JSONArray) (matchesObject.get("response"));
|
||||
|
||||
for(int i = 0; i < matchArray.size(); i++) {
|
||||
try {
|
||||
@@ -83,19 +84,18 @@ public class APIFootballConnector {
|
||||
public JSONObject getMatchdays(int leagueId) {
|
||||
S3Provider prov = new S3Provider();
|
||||
if(!this.rounds.containsKey(leagueId)) {
|
||||
this.rounds.put(leagueId, prov.getRoundsJSONFromS3(leagueId));
|
||||
this.rounds.put(leagueId, prov.getRoundsJSONFromS3(this.season, leagueId));
|
||||
}
|
||||
return this.rounds.get(leagueId);
|
||||
}
|
||||
|
||||
public JSONObject getTeamsForLeague(int league) throws Exception {
|
||||
String url = "https://v2.api-football.com/teams/league/" + league;
|
||||
String content = new APIFootballUpdater().getRawData(url);
|
||||
public JSONObject getTeamsForLeague(int season, int league) throws Exception {
|
||||
String requestPath = "teams";
|
||||
String content = new APIFootballUpdater().getRawData(requestPath, season, league);
|
||||
return stringToJSONObject(content);
|
||||
}
|
||||
|
||||
public static JSONObject stringToJSONObject(String rawData) {
|
||||
|
||||
JSONParser parser = new JSONParser();
|
||||
JSONObject data = null;
|
||||
try {
|
||||
|
||||
@@ -1,35 +1,31 @@
|
||||
package de.jeyp91.apifootball;
|
||||
|
||||
import de.jeyp91.BaseMatch;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import de.jeyp91.BaseMatch;
|
||||
|
||||
public class APIFootballMatch extends BaseMatch {
|
||||
|
||||
private final int matchId;
|
||||
private final int leagueId;
|
||||
private final String teamNameHome;
|
||||
private final String teamNameGuest;
|
||||
private final String round;
|
||||
private Boolean showTable = null;
|
||||
private int matchId;
|
||||
private int leagueId;
|
||||
private String round;
|
||||
|
||||
public APIFootballMatch(JSONObject json, int season) throws Exception {
|
||||
this.matchId = Integer.parseInt(json.get("fixture_id").toString());
|
||||
// TODO
|
||||
this.leagueId = Integer.parseInt(json.get("league_id").toString());
|
||||
this.teamIdHome = Integer.parseInt(((JSONObject) json.get("homeTeam")).get("team_id").toString());
|
||||
this.teamIdGuest = Integer.parseInt(((JSONObject) json.get("awayTeam")).get("team_id").toString());
|
||||
this.teamNameHome = ((JSONObject) json.get("homeTeam")).get("team_name").toString();
|
||||
this.teamNameGuest = ((JSONObject) json.get("awayTeam")).get("team_name").toString();
|
||||
this.goalsHome = getNumberOrNull(json.get("goalsHomeTeam"));
|
||||
this.goalsGuest = getNumberOrNull(json.get("goalsAwayTeam"));
|
||||
this.round = json.get("round").toString();
|
||||
this.matchId = Integer.parseInt(((JSONObject) json.get("fixture")).get("id").toString());
|
||||
this.leagueId = Integer.parseInt(((JSONObject) json.get("league")).get("id").toString());
|
||||
this.teamIdHome = Integer.valueOf(((JSONObject) ((JSONObject) json.get("teams")).get("home")).get("id").toString());
|
||||
this.teamIdGuest = Integer.valueOf(((JSONObject) ((JSONObject) json.get("teams")).get("away")).get("id").toString());
|
||||
this.teamNameHome = ((JSONObject) ((JSONObject) json.get("teams")).get("home")).get("name").toString();
|
||||
this.teamNameGuest = ((JSONObject) ((JSONObject) json.get("teams")).get("away")).get("name").toString();
|
||||
this.round = ((JSONObject) json.get("league")).get("round").toString();
|
||||
try {
|
||||
this.matchday = getMatchdayFromRoundString(season, this.round, this.leagueId);
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Did not find matchday for league '" + this.leagueId + "': '" + json.get("round").toString() + "'");
|
||||
}
|
||||
this.matchDatetime = (String) json.get("event_date");
|
||||
this.matchDatetime = (String) ((JSONObject) json.get("fixture")).get("date");
|
||||
this.status = parseStatus(((JSONObject) ((JSONObject) json.get("fixture")).get("status")).get("short").toString());
|
||||
this.parseResult(json);
|
||||
}
|
||||
|
||||
@@ -39,54 +35,50 @@ public class APIFootballMatch extends BaseMatch {
|
||||
|
||||
public static int getMatchdayFromRoundString(int season, String round, int leagueId) {
|
||||
round = round.replace(" ", "_");
|
||||
Integer matchday = null;
|
||||
APIFootballConnector con = APIFootballConnector.getAPIFootballConnectorInstance(season);
|
||||
JSONObject roundsObject = con.getMatchdays(leagueId);
|
||||
JSONArray roundsArray = (JSONArray)(((JSONObject) roundsObject.get("api")).get("fixtures"));
|
||||
for (int i = 0; i < roundsArray.size(); i++) {
|
||||
if(roundsArray.get(i).toString().equals(round)) {
|
||||
matchday = i + 1;
|
||||
break;
|
||||
Integer matchday = -1;
|
||||
if (round.startsWith("Regular_Season_-_")) {
|
||||
matchday = Integer.valueOf(round.replace("Regular_Season_-_", ""));
|
||||
} else {
|
||||
APIFootballConnector con = APIFootballConnector.getAPIFootballConnectorInstance(season);
|
||||
JSONObject roundsObject = con.getMatchdays(leagueId);
|
||||
JSONArray roundsArray = (JSONArray)(roundsObject.get("response"));
|
||||
for (int i = 0; i < roundsArray.size(); i++) {
|
||||
if(roundsArray.get(i).toString().replace("_", " ").equals(round.replace("_", " "))) {
|
||||
matchday = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return matchday;
|
||||
}
|
||||
|
||||
private Integer getNumberOrNull(Object object) {
|
||||
return object != null ? Integer.parseInt(object.toString()) : null;
|
||||
}
|
||||
|
||||
public String getTeamNameHome() {
|
||||
return this.teamNameHome;
|
||||
}
|
||||
|
||||
public String getTeamNameGuest() {
|
||||
return this.teamNameGuest;
|
||||
return object != null ? Integer.valueOf(object.toString()) : null;
|
||||
}
|
||||
|
||||
public String getRound() {
|
||||
return this.round;
|
||||
}
|
||||
|
||||
public void setShowTable(boolean showTable) {
|
||||
this.showTable = showTable;
|
||||
}
|
||||
|
||||
public Boolean getShowTable() {
|
||||
return this.showTable;
|
||||
private int parseStatus(String statusShort) {
|
||||
return switch (statusShort) {
|
||||
case "TBD", "NS" -> 0;
|
||||
case "FT", "AET", "PEN" -> 3;
|
||||
default -> 1;
|
||||
};
|
||||
}
|
||||
|
||||
private void parseResult(JSONObject json) {
|
||||
Object resultFulltime = ((JSONObject) json.get("score")).get("fulltime");
|
||||
if(resultFulltime != null) {
|
||||
this.goalsHome = Integer.parseInt(resultFulltime.toString().substring(0, 1));
|
||||
this.goalsGuest = Integer.parseInt(resultFulltime.toString().substring(2, 3));
|
||||
}
|
||||
this.goalsHome = getNumberOrNull(((JSONObject) resultFulltime).get("home"));
|
||||
this.goalsGuest = getNumberOrNull(((JSONObject) resultFulltime).get("away"));
|
||||
|
||||
Object resultExtratime = ((JSONObject) json.get("score")).get("extratime");
|
||||
if(resultExtratime != null) {
|
||||
this.goalsOvertimeHome = this.goalsHome + Integer.parseInt(resultExtratime.toString().substring(0, 1));
|
||||
this.goalsOvertimeGuest = this.goalsGuest + Integer.parseInt(resultExtratime.toString().substring(2, 3));
|
||||
}
|
||||
this.goalsOvertimeHome = getNumberOrNull(((JSONObject) resultExtratime).get("home"));
|
||||
this.goalsOvertimeGuest = getNumberOrNull(((JSONObject) resultExtratime).get("away"));
|
||||
|
||||
Object resultPenalty = ((JSONObject) json.get("score")).get("penalty");
|
||||
this.goalsPenaltyHome = getNumberOrNull(((JSONObject) resultPenalty).get("home"));
|
||||
this.goalsPenaltyGuest = getNumberOrNull(((JSONObject) resultPenalty).get("away"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,18 @@ public class APIFootballMatchesProvider {
|
||||
|
||||
APIFootballConnector conn;
|
||||
public APIFootballMatchesProvider(int season) {
|
||||
this.conn = APIFootballConnector.getAPIFootballConnectorInstance(season - 1);
|
||||
this.conn = APIFootballConnector.getAPIFootballConnectorInstance(season);
|
||||
}
|
||||
|
||||
public ArrayList<APIFootballMatch> getAPIFootballMatchesFromConfig(JSONArray config) {
|
||||
public ArrayList<APIFootballMatch> getAPIFootballMatchesFromConfig(JSONObject matchdayConfig) {
|
||||
boolean ko = false;
|
||||
try {
|
||||
ko = (boolean) matchdayConfig.get("ko");
|
||||
} catch (Exception e) {
|
||||
// Nothing to do here
|
||||
}
|
||||
ArrayList<APIFootballMatch> apiFootballMatches = new ArrayList<>();
|
||||
for (Object singleConfigObject : config) {
|
||||
for (Object singleConfigObject : (JSONArray) matchdayConfig.get("matchesConfig")) {
|
||||
JSONObject singleConfig = (JSONObject) singleConfigObject;
|
||||
String type = (String) singleConfig.get("type");
|
||||
boolean showTable = false;
|
||||
@@ -29,7 +35,11 @@ public class APIFootballMatchesProvider {
|
||||
e.printStackTrace();
|
||||
}
|
||||
boolean finalShowTable = showTable;
|
||||
matches.forEach(apiFootballMatch -> apiFootballMatch.setShowTable(finalShowTable));
|
||||
boolean finalKo = ko;
|
||||
matches.forEach(apiFootballMatch -> {
|
||||
apiFootballMatch.setShowTable(finalShowTable);
|
||||
apiFootballMatch.setKoMatch(finalKo);
|
||||
});
|
||||
apiFootballMatches.addAll(matches);
|
||||
break;
|
||||
case "SingleMatch":
|
||||
@@ -38,6 +48,7 @@ public class APIFootballMatchesProvider {
|
||||
APIFootballMatch match = conn.getMatchDataByLeagueAndMatchID(matchLeague, matchId);
|
||||
showTable = (boolean) singleConfig.get("showTable");
|
||||
match.setShowTable(showTable);
|
||||
match.setKoMatch(ko);
|
||||
apiFootballMatches.add(match);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,41 +1,43 @@
|
||||
package de.jeyp91.apifootball;
|
||||
|
||||
import de.jeyp91.ResourceProvider;
|
||||
import de.jeyp91.S3Provider;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.HashSet;
|
||||
import de.jeyp91.ResourceProvider;
|
||||
import de.jeyp91.S3Provider;
|
||||
|
||||
public class APIFootballUpdater {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(APIFootballUpdater.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(APIFootballUpdater.class);
|
||||
private static final String BASE_URL = "https://v3.football.api-sports.io/";
|
||||
|
||||
public APIFootballUpdater() {
|
||||
|
||||
}
|
||||
|
||||
public void updateFixtures(int league) {
|
||||
String apiFootballUrl = "https://v2.api-football.com/fixtures/league/" + league + "?timezone=Europe/Berlin";
|
||||
public void updateFixtures(int season, int league) {
|
||||
String requestPath = "fixtures";
|
||||
S3Provider prov = new S3Provider();
|
||||
try {
|
||||
String content = getRawData(apiFootballUrl);
|
||||
S3Provider prov = new S3Provider();
|
||||
prov.writeFixturesToS3(league, content);
|
||||
String content = getRawData(requestPath, season, league);
|
||||
prov.writeFixturesToS3(season, league, content);
|
||||
} catch (Exception e) {
|
||||
if(e.getMessage().endsWith("did not have any results with status: 'Too many requests. Your rate limit is 10 requests per minute.'")) {
|
||||
if(e.getMessage().toLowerCase().contains("rate limit'")) {
|
||||
try {
|
||||
Thread.sleep(1000 * 60);
|
||||
String content = getRawData(apiFootballUrl);
|
||||
S3Provider prov = new S3Provider();
|
||||
prov.writeFixturesToS3(league, content);
|
||||
String content = getRawData(requestPath, season, league);
|
||||
prov.writeFixturesToS3(season, league, content);
|
||||
} catch (InterruptedException interruptedException) {
|
||||
interruptedException.printStackTrace();
|
||||
} catch (Exception exception) {
|
||||
@@ -48,32 +50,41 @@ public class APIFootballUpdater {
|
||||
}
|
||||
|
||||
public void updateAllFixtures(int season) {
|
||||
HashSet<Integer> leagues = getLeagues(season);
|
||||
HashSet<Integer> leagues = getLeagues();
|
||||
for (Integer league : leagues) {
|
||||
updateFixtures(league);
|
||||
updateFixtures(season, league);
|
||||
try {
|
||||
Thread.sleep(1000*6);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateAllRounds(int season) {
|
||||
HashSet<Integer> leagues = getLeagues(season);
|
||||
HashSet<Integer> leagues = getLeagues();
|
||||
for (Integer league : leagues) {
|
||||
updateRounds(league);
|
||||
updateRounds(season, league);
|
||||
try {
|
||||
Thread.sleep(1000*6);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateRounds(int league) {
|
||||
String apiFootballUrl = "https://v2.api-football.com/fixtures/rounds/" + league;
|
||||
public void updateRounds(int season, int league) {
|
||||
String requestPath = "fixtures/rounds";
|
||||
S3Provider prov = new S3Provider();
|
||||
try {
|
||||
String content = getRawData(apiFootballUrl);
|
||||
S3Provider prov = new S3Provider();
|
||||
prov.writeRoundsToS3(league, content);
|
||||
String content = getRawData(requestPath, season, league);
|
||||
prov.writeRoundsToS3(season, league, content);
|
||||
} catch (Exception e) {
|
||||
if(e.getMessage().endsWith("did not have any results with status: 'Too many requests. Your rate limit is 10 requests per minute.'")) {
|
||||
if(e.getMessage().toLowerCase().contains("rate limit'")) {
|
||||
try {
|
||||
Thread.sleep(1000 * 60);
|
||||
String content = getRawData(apiFootballUrl);
|
||||
S3Provider prov = new S3Provider();
|
||||
prov.writeRoundsToS3(league, content);
|
||||
String content = getRawData(requestPath, season, league);
|
||||
prov.writeRoundsToS3(season, league, content);
|
||||
} catch (InterruptedException interruptedException) {
|
||||
interruptedException.printStackTrace();
|
||||
} catch (Exception exception) {
|
||||
@@ -85,54 +96,37 @@ public class APIFootballUpdater {
|
||||
}
|
||||
}
|
||||
|
||||
public String getRawData(String requestUrl) throws Exception {
|
||||
public String getRawData(String requestPath, int season, int league) throws Exception {
|
||||
if(league != 1 && league != 4) {
|
||||
/**
|
||||
* Season usually is one higher in Tippliga than in API-Football.
|
||||
* e.g. 2023/24 is 2024 in Tippliga and 2023 in API-Football.
|
||||
* Because Liga Cup in Tippliga is at the end of a season, season does match World Cup (1) and Euro Championship (4)
|
||||
*/
|
||||
season--;
|
||||
}
|
||||
|
||||
HttpClient client = HttpClientBuilder.create().build();
|
||||
String requestUrl = BASE_URL + requestPath + "?season=" + (season) + "&league=" + league + "&timezone=Europe/Berlin";
|
||||
HttpGet request = new HttpGet(requestUrl);
|
||||
|
||||
// add request header
|
||||
request.addHeader("X-RapidAPI-Key", "a607e6a7437d9d52f3ac73e0b2704d0b");
|
||||
|
||||
HttpResponse response = null;
|
||||
try {
|
||||
response = client.execute(request);
|
||||
} catch (IOException e) {
|
||||
/* TODO */
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
BufferedReader rd = null;
|
||||
try {
|
||||
assert response != null;
|
||||
rd = new BufferedReader(
|
||||
new InputStreamReader(response.getEntity().getContent())
|
||||
);
|
||||
} catch (IOException e) {
|
||||
/* TODO */
|
||||
e.printStackTrace();
|
||||
}
|
||||
request.addHeader("x-rapidapi-host", "v3.football.api-sports.io");
|
||||
request.addHeader("x-rapidapi-key", "a607e6a7437d9d52f3ac73e0b2704d0b");
|
||||
|
||||
HttpResponse response = client.execute(request);
|
||||
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
|
||||
StringBuilder result = new StringBuilder();
|
||||
String line = "";
|
||||
while (true) {
|
||||
try {
|
||||
line = rd.readLine();
|
||||
} catch (IOException e) {
|
||||
/* TODO */
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Stop reading if last line was found.
|
||||
if (line == null) break;
|
||||
|
||||
String line;
|
||||
while ((line = rd.readLine()) != null) {
|
||||
result.append(line);
|
||||
}
|
||||
checkErrors(requestUrl, result.toString());
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public HashSet<Integer> getLeagues(int season) {
|
||||
JSONArray leaguesArray = ResourceProvider.getLigenConfig(season);
|
||||
public HashSet<Integer> getLeagues() {
|
||||
JSONArray leaguesArray = ResourceProvider.getLigenConfig();
|
||||
HashSet<Integer> leagues = new HashSet<>();
|
||||
for (Object leagueObject : leaguesArray) {
|
||||
JSONObject leagueJSONObject = (JSONObject) leagueObject;
|
||||
@@ -144,15 +138,15 @@ public class APIFootballUpdater {
|
||||
|
||||
public void checkErrors(String requestUrl, String result) throws Exception {
|
||||
JSONObject resultObject = stringToJSONObject(result);
|
||||
boolean containsError = ((JSONObject) resultObject.get("api")).containsKey("error");
|
||||
int results = Integer.parseInt(((JSONObject) resultObject.get("api")).get("results").toString());
|
||||
boolean containsError = !((JSONArray) resultObject.get("errors")).isEmpty();
|
||||
// int results = Integer.parseInt(resultObject.get("results").toString());
|
||||
if(containsError) {
|
||||
String errorMessage = ((JSONObject) resultObject.get("api")).get("error").toString();
|
||||
String errorMessage = resultObject.get("errors").toString();
|
||||
throw new Exception(requestUrl + " returned error: '" + errorMessage + "'");
|
||||
} else if (results == 0) {
|
||||
String statusMessage = ((JSONObject) resultObject.get("api")).get("status").toString();
|
||||
throw new Exception(requestUrl + " did not have any results with status: '" + statusMessage + "'");
|
||||
}
|
||||
// else if (results == 0) {
|
||||
// throw new Exception(requestUrl + " did not have any results.");
|
||||
// }
|
||||
}
|
||||
|
||||
private JSONObject stringToJSONObject(String rawData) {
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.google.auth.oauth2.GoogleCredentials;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class GoogleCalendarConnector {
|
||||
private static final String APPLICATION_NAME = "Google Calendar API Java Quickstart";
|
||||
|
||||
@@ -4,19 +4,18 @@ import com.google.api.client.util.DateTime;
|
||||
import com.google.api.services.calendar.Calendar;
|
||||
import com.google.api.services.calendar.model.Event;
|
||||
import com.google.api.services.calendar.model.EventDateTime;
|
||||
import com.google.api.services.calendar.model.EventReminder;
|
||||
import com.google.api.services.calendar.model.Events;
|
||||
import de.jeyp91.tippliga.TLWLeague;
|
||||
import de.jeyp91.tippliga.TLWMatchday;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import de.jeyp91.tippligaforum.TippligaSQLConnector;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static de.jeyp91.googlecalendar.GoogleCalendarConnector.getSerivce;
|
||||
@@ -24,7 +23,9 @@ import static de.jeyp91.googlecalendar.GoogleCalendarConnector.getSerivce;
|
||||
public class TippligaGoogleEventManager {
|
||||
|
||||
private static List<Event> allEvents = null;
|
||||
private static final Logger logger = LogManager.getLogger(TippligaGoogleEventManager.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(TippligaGoogleEventManager.class);
|
||||
|
||||
private static final HashMap<String, String> allLeagueNames = new HashMap<>();
|
||||
|
||||
public static List<Event> getAllEvents(Integer season) {
|
||||
if(allEvents == null) {
|
||||
@@ -60,6 +61,9 @@ public class TippligaGoogleEventManager {
|
||||
public static Event findEvent(List<Event> allEvents, Integer season, Integer league, Integer matchday, Integer deliveryDateNumber) {
|
||||
String description = getDescription(season, league, matchday, deliveryDateNumber);
|
||||
String descriptionHtml = getDescriptionHTML(season, league, matchday, deliveryDateNumber);
|
||||
if(matchday == 34) {
|
||||
String debug = "";
|
||||
}
|
||||
for (Event event : allEvents) {
|
||||
String eventDescription = event.getDescription();
|
||||
if (
|
||||
@@ -86,8 +90,10 @@ public class TippligaGoogleEventManager {
|
||||
}
|
||||
else {
|
||||
String googleEventStart = event.getStart().getDateTime().toString();
|
||||
String googleEventEnd = event.getEnd().getDateTime().toString();
|
||||
String googleEventStartBeautified = googleEventStart.substring(0, 19).replace("T", " ");
|
||||
if(!googleEventStartBeautified.equals(deliveryDateString)) {
|
||||
if(!googleEventStartBeautified.equals(deliveryDateString)
|
||||
|| !googleEventEnd.equals(googleEventStart)) {
|
||||
updateEvent(event, matchday, deliveryDateString, deliverDateNumber);
|
||||
}
|
||||
}
|
||||
@@ -144,7 +150,7 @@ public class TippligaGoogleEventManager {
|
||||
|
||||
private static Event getEvent(TLWMatchday matchday, String deliveryDateString, Integer deliverDateNumber) {
|
||||
String matchdayName = matchday.getMatchdayName().equals("") ? matchday.getMatchday().toString() + ". Spieltag" : matchday.getMatchdayName();
|
||||
String summary = TLWLeague.getLeagueNameCalendar(matchday.getLeague()) + " " + matchdayName + " tippen!";
|
||||
String summary = getLeagueNameCalendar(matchday.getSeason(), matchday.getLeague()) + " " + matchdayName + " tippen!";
|
||||
if(deliverDateNumber > 1) summary += " " + deliverDateNumber + ". Chance \uD83D\uDE43";
|
||||
String description = getDescription(matchday.getSeason(), matchday.getLeague(), matchday.getMatchday(), deliverDateNumber);
|
||||
String location = "https://tippliga-wuerzburg.de/app.php/football/bet";
|
||||
@@ -156,7 +162,7 @@ public class TippligaGoogleEventManager {
|
||||
.setDateTime(deliveryDateTime)
|
||||
.setTimeZone("Europe/Berlin");
|
||||
|
||||
// Set reminder to 12 hours before
|
||||
// Set reminder to 12 remainingHours before
|
||||
Event.Reminders reminders = new Event.Reminders();
|
||||
reminders.setUseDefault(true);
|
||||
|
||||
@@ -195,4 +201,13 @@ public class TippligaGoogleEventManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static String getLeagueNameCalendar(Integer season, Integer league) {
|
||||
String seasonLeagueId = season.toString() + league.toString();
|
||||
|
||||
if(!allLeagueNames.containsKey(seasonLeagueId)) {
|
||||
allLeagueNames.put(seasonLeagueId, TippligaSQLConnector.getInstance().getLeague(season.toString(), league.toString()).getLeagueNameCalendar());
|
||||
}
|
||||
return allLeagueNames.get(seasonLeagueId);
|
||||
}
|
||||
}
|
||||
@@ -4,14 +4,15 @@ import com.google.common.collect.HashBiMap;
|
||||
import de.jeyp91.ResourceProvider;
|
||||
import de.jeyp91.StatusHolder;
|
||||
import de.jeyp91.apifootball.APIFootballMatch;
|
||||
import org.apache.logging.log4j.*;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TeamIDMatcher {
|
||||
|
||||
private static HashBiMap<Integer, Integer> ids = null;
|
||||
private static final Logger logger = LogManager.getLogger(TeamIDMatcher.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(TeamIDMatcher.class);
|
||||
private static JSONArray teams;
|
||||
private static boolean init = false;
|
||||
public static final int HOME = 0;
|
||||
|
||||
@@ -10,7 +10,7 @@ public class TeamIDMatcherTemplateCreator {
|
||||
|
||||
public TeamIDMatcherTemplateCreator(int season, int league) throws Exception {
|
||||
this.con = APIFootballConnector.getAPIFootballConnectorInstance(season);
|
||||
JSONObject apiObject = con.getTeamsForLeague(league);
|
||||
JSONObject apiObject = con.getTeamsForLeague(season, league);
|
||||
JSONObject teamsObject = (JSONObject) apiObject.get("api");
|
||||
this.teams = (JSONArray) teamsObject.get("teams");
|
||||
}
|
||||
|
||||
@@ -1,75 +1,50 @@
|
||||
package de.jeyp91.tippliga;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class TLWLeague {
|
||||
public static String getLeagueName(int id) {
|
||||
String leagueName = "";
|
||||
switch (id) {
|
||||
case 1:
|
||||
leagueName = "Tippliga";
|
||||
break;
|
||||
case 46:
|
||||
leagueName = "Elfmeter";
|
||||
break;
|
||||
case 47:
|
||||
leagueName = "Relegation";
|
||||
break;
|
||||
case 48:
|
||||
leagueName = "WTL-Pokal";
|
||||
break;
|
||||
case 49:
|
||||
leagueName = "Liga-Cup";
|
||||
break;
|
||||
default: break;
|
||||
|
||||
private Integer season = null;
|
||||
private Integer league = null;
|
||||
private String leagueName = null;
|
||||
private String leagueNameShort = null;
|
||||
|
||||
public TLWLeague(ResultSet rset) {
|
||||
final int SEASON = 1;
|
||||
final int LEAGUE = 2;
|
||||
final int LEAGUE_NAME = 3;
|
||||
final int LEAGUE_NAME_SHORT = 4;
|
||||
try {
|
||||
this.season = Integer.parseInt(rset.getString(SEASON));
|
||||
this.league = Integer.parseInt(rset.getString(LEAGUE));
|
||||
this.leagueName = rset.getString(LEAGUE_NAME);
|
||||
this.leagueNameShort = rset.getString(LEAGUE_NAME_SHORT);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return leagueName;
|
||||
}
|
||||
|
||||
public static String getLeagueNameShort(int id) {
|
||||
String leagueName = "";
|
||||
switch (id) {
|
||||
case 1:
|
||||
leagueName = "1. TLW";
|
||||
break;
|
||||
case 2:
|
||||
leagueName = "2. TLW";
|
||||
break;
|
||||
case 46:
|
||||
leagueName = "ELF";
|
||||
break;
|
||||
case 47:
|
||||
leagueName = "REL";
|
||||
break;
|
||||
case 48:
|
||||
leagueName = "WTL";
|
||||
break;
|
||||
case 49:
|
||||
leagueName = "LC";
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
return leagueName;
|
||||
public Integer getSeason() {
|
||||
return this.season;
|
||||
}
|
||||
|
||||
public static String getLeagueNameCalendar(int id) {
|
||||
String leagueName = "";
|
||||
switch (id) {
|
||||
case 1:
|
||||
case 2:
|
||||
leagueName = "Tippliga";
|
||||
break;
|
||||
case 46:
|
||||
leagueName = "Elfmeter";
|
||||
break;
|
||||
case 47:
|
||||
leagueName = "Relegation";
|
||||
break;
|
||||
case 48:
|
||||
leagueName = "WTL-Pokal";
|
||||
break;
|
||||
case 49:
|
||||
leagueName = "Liga Cup";
|
||||
break;
|
||||
default: break;
|
||||
public Integer getLeague() {
|
||||
return this.league;
|
||||
}
|
||||
|
||||
public String getLeagueName() {
|
||||
return this.leagueName;
|
||||
}
|
||||
|
||||
public String getLeagueNameShort() {
|
||||
return this.leagueNameShort;
|
||||
}
|
||||
|
||||
public String getLeagueNameCalendar() {
|
||||
String leagueName = this.leagueName;
|
||||
if (leagueName.equals("1. Tippliga Würzburg") || leagueName.equals("2. Tippliga Würzburg")) {
|
||||
leagueName = "Tippliga";
|
||||
}
|
||||
return leagueName;
|
||||
}
|
||||
|
||||
@@ -2,22 +2,20 @@ package de.jeyp91.tippliga;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Objects;
|
||||
|
||||
import de.jeyp91.App;
|
||||
import de.jeyp91.BaseMatch;
|
||||
import de.jeyp91.teamidmatcher.TeamIDMatcher;
|
||||
import de.jeyp91.apifootball.APIFootballMatch;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class TLWMatch extends BaseMatch{
|
||||
|
||||
public final Integer STATUS_NOTSTARTED = 0;
|
||||
public final Integer STATUS_STARTED = 1;
|
||||
public final Integer STATUS_PROVISIONAL_RESULT_AVAILABLE = 2;
|
||||
public final Integer STATUS_FINISHED = 3;
|
||||
private static final Logger logger = LoggerFactory.getLogger(TLWMatch.class);
|
||||
|
||||
private Integer season = null;
|
||||
private Integer league = null;
|
||||
@@ -25,11 +23,6 @@ public class TLWMatch extends BaseMatch{
|
||||
private String groupId = null;
|
||||
private String formulaHome = null;
|
||||
private String formulaGuest = null;
|
||||
private Integer status = null;
|
||||
private Integer koMatch = 0;
|
||||
private Integer goalsOvertimeHome = null;
|
||||
private Integer goalsOvertimeGuest = null;
|
||||
private Integer showTable = null;
|
||||
private String trend = null;
|
||||
private Float odd1 = null;
|
||||
private Float oddX = null;
|
||||
@@ -161,6 +154,14 @@ public class TLWMatch extends BaseMatch{
|
||||
this.rating = referenceMatch.rating;
|
||||
}
|
||||
|
||||
public TLWMatch(String formulaHome, String formulaGuest, String matchDateTime) {
|
||||
this.teamIdHome = 0;
|
||||
this.teamIdGuest = 0;
|
||||
this.formulaHome = formulaHome;
|
||||
this.formulaGuest = formulaGuest;
|
||||
this.matchDatetime = matchDateTime;
|
||||
}
|
||||
|
||||
public Integer getSeason() {
|
||||
return this.season;
|
||||
}
|
||||
@@ -173,28 +174,13 @@ public class TLWMatch extends BaseMatch{
|
||||
return this.matchNo;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public Integer getKoMatch() {
|
||||
return this.koMatch;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return this.groupId;
|
||||
}
|
||||
|
||||
public Integer getShowTable() {
|
||||
return this.showTable;
|
||||
}
|
||||
|
||||
public String getFormulaHome() {
|
||||
String formula = "'D'";
|
||||
if(this.teamIdHome != null) {
|
||||
return "''";
|
||||
}
|
||||
else if (this.formulaHome != null) {
|
||||
if (this.formulaHome != null) {
|
||||
formula = this.formulaHome;
|
||||
}
|
||||
return formula;
|
||||
@@ -202,10 +188,7 @@ public class TLWMatch extends BaseMatch{
|
||||
|
||||
public String getFormulaGuest() {
|
||||
String formula = "'D'";
|
||||
if(this.teamIdGuest != null) {
|
||||
return "''";
|
||||
}
|
||||
else if (this.formulaGuest != null) {
|
||||
if (this.formulaGuest != null) {
|
||||
formula = this.formulaGuest;
|
||||
}
|
||||
return formula;
|
||||
@@ -268,18 +251,10 @@ public class TLWMatch extends BaseMatch{
|
||||
this.goalsOvertimeGuest = goals;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setMatchDateTime(String matchDateTime) {
|
||||
this.matchDatetime = matchDateTime;
|
||||
}
|
||||
|
||||
public void setShowTable(Boolean showTable) {
|
||||
this.showTable = showTable ? 0 : 1;
|
||||
}
|
||||
|
||||
public void updateMatch(APIFootballMatch apiFootballMatch) {
|
||||
this.teamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.HOME);
|
||||
this.teamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.GUEST);
|
||||
@@ -297,4 +272,24 @@ public class TLWMatch extends BaseMatch{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isSameMatchPlaceholder (TLWMatch tlwMatch, TLWMatch placeholderConfigMatch) {
|
||||
String placeholderConfigMatchDateTime = placeholderConfigMatch.getMatchDateTime();
|
||||
String tlwMatchDateTime = tlwMatch.getMatchDateTime();
|
||||
String placeholderConfigMatchFormulaHome = placeholderConfigMatch.getFormulaHome();
|
||||
String tlwMatchFormulaHome = tlwMatch.getFormulaHome();
|
||||
String placeholderConfigMatchFormulaGuest = placeholderConfigMatch.getFormulaGuest();
|
||||
String tlwMatchFormulaGuest = tlwMatch.getFormulaGuest();
|
||||
if(Objects.equals(tlwMatchDateTime, placeholderConfigMatchDateTime) &&
|
||||
Objects.equals(tlwMatchFormulaHome, placeholderConfigMatchFormulaHome) &&
|
||||
Objects.equals(tlwMatchFormulaGuest, placeholderConfigMatchFormulaGuest)) {
|
||||
return true;
|
||||
}
|
||||
if(Objects.equals(tlwMatchDateTime, placeholderConfigMatchDateTime) &&
|
||||
Objects.equals(tlwMatch.getTeamIdHome(), null) &&
|
||||
Objects.equals(tlwMatch.getTeamIdGuest(), null)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,6 @@ import java.sql.SQLException;
|
||||
|
||||
public class TLWMatchday {
|
||||
|
||||
final Integer STATUS_NOTSTARTED = 0;
|
||||
final Integer STATUS_STARTED = 1;
|
||||
final Integer STATUS_PROVISIONAL_RESULT_AVAILABLE = 2;
|
||||
final Integer STATUS_FINISHED = 3;
|
||||
|
||||
private Integer season = null;
|
||||
private Integer league = null;
|
||||
private Integer matchday = null;
|
||||
@@ -34,15 +29,15 @@ public class TLWMatchday {
|
||||
final int MATCHES = 9;
|
||||
|
||||
try {
|
||||
this.season = Integer.parseInt(rset.getString(SEASON));
|
||||
this.league = Integer.parseInt(rset.getString(LEAGUE));
|
||||
this.matchday = Integer.parseInt(rset.getString(MATCHDAY));
|
||||
this.status = Integer.parseInt(rset.getString(STATUS));
|
||||
this.season = Integer.valueOf(rset.getString(SEASON));
|
||||
this.league = Integer.valueOf(rset.getString(LEAGUE));
|
||||
this.matchday = Integer.valueOf(rset.getString(MATCHDAY));
|
||||
this.status = Integer.valueOf(rset.getString(STATUS));
|
||||
this.deliveryDate = rset.getString(DELIVERY_DATE);
|
||||
this.deliveryDate2 = rset.getString(DELIVERY_DATE_2);
|
||||
this.deliveryDate3 = rset.getString(DELIVERY_DATE_3);
|
||||
this.matchdayName = rset.getString(MATCHDAY_NAME);
|
||||
this.matches = Integer.parseInt(rset.getString(MATCHES));
|
||||
this.matches = Integer.valueOf(rset.getString(MATCHES));
|
||||
} catch (SQLException e) {
|
||||
/* TODO */
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package de.jeyp91.tippliga;
|
||||
|
||||
import de.jeyp91.tippligaforum.TippligaSQLConnector;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -13,7 +13,7 @@ import static de.jeyp91.googlecalendar.TippligaGoogleEventManager.*;
|
||||
|
||||
public class TLWMatchdaysUpdater {
|
||||
|
||||
private final Logger logger = LogManager.getLogger(TLWMatch.class);
|
||||
private final Logger logger = LoggerFactory.getLogger(TLWMatch.class);
|
||||
|
||||
int season;
|
||||
int league;
|
||||
@@ -29,8 +29,7 @@ public class TLWMatchdaysUpdater {
|
||||
this.matchdaysOriginal = conn.getMatchdays(String.valueOf(season), String.valueOf(league));
|
||||
this.matchdaysOriginal.sort(Comparator.comparing(TLWMatchday::getMatchday));
|
||||
|
||||
TLWMatchdaysCreator creator = new TLWMatchdaysCreator(season, league, configPath);
|
||||
this.matchdaysUpdated = creator.getMatchdays();
|
||||
this.matchdaysUpdated = conn.getUpdatedMatchdaysBasedOnMatches(String.valueOf(season), String.valueOf(league));
|
||||
this.matchdaysUpdated.sort(Comparator.comparing(TLWMatchday::getMatchday));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public abstract class TLWMatchesCreatorBase {
|
||||
|
||||
// Add matches from config
|
||||
for(TLWMatch match : tlwMatches) {
|
||||
sql += match.getSQLQueryInsert() + "\n";
|
||||
sql += match.getSQLQueryReplace() + "\n";
|
||||
}
|
||||
|
||||
return sql;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class TLWMatchesCreatorFootball extends TLWMatchesCreatorBase {
|
||||
|
||||
this.season = season;
|
||||
this.league = league;
|
||||
this.conn = APIFootballConnector.getAPIFootballConnectorInstance(season - 1);
|
||||
this.conn = APIFootballConnector.getAPIFootballConnectorInstance(season);
|
||||
|
||||
TippligaConfigProvider prov = new TippligaConfigProvider(season);
|
||||
this.config = prov.getTippligaConfig(configFileName);
|
||||
|
||||
@@ -3,8 +3,8 @@ package de.jeyp91.tippliga;
|
||||
import de.jeyp91.ResourceProvider;
|
||||
import de.jeyp91.StatusHolder;
|
||||
import de.jeyp91.tippligaforum.TippligaConfigProvider;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.ArrayList;
|
||||
|
||||
public class TLWMatchesCreatorTipperLeague extends TLWMatchesCreatorBase {
|
||||
|
||||
private final Logger logger = LogManager.getLogger(TLWMatchesCreatorTipperLeague.class);
|
||||
private final Logger logger = LoggerFactory.getLogger(TLWMatchesCreatorTipperLeague.class);
|
||||
|
||||
int season;
|
||||
int league;
|
||||
|
||||
@@ -2,8 +2,8 @@ package de.jeyp91.tippliga;
|
||||
|
||||
import de.jeyp91.ResourceProvider;
|
||||
import de.jeyp91.tippligaforum.TippligaConfigProvider;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.ArrayList;
|
||||
|
||||
public class TLWMatchesCreatorTipperPokal extends TLWMatchesCreatorBase{
|
||||
|
||||
Logger logger = LogManager.getLogger(TLWMatchesCreatorTipperPokal.class);
|
||||
Logger logger = LoggerFactory.getLogger(TLWMatchesCreatorTipperPokal.class);
|
||||
|
||||
int season;
|
||||
int league;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.jeyp91.tippliga;
|
||||
|
||||
import de.jeyp91.apifootball.APIFootballMatch;
|
||||
import de.jeyp91.teamidmatcher.TeamIDMatcher;
|
||||
import de.jeyp91.tippligaforum.TippligaConfigProvider;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
@@ -15,8 +16,9 @@ public class TLWMatchesManagerBase {
|
||||
protected int season;
|
||||
protected int league;
|
||||
protected int numberOfMatchdays;
|
||||
protected int matchesPerMatchday;
|
||||
protected Integer matchesPerMatchday = null;
|
||||
protected int ko;
|
||||
protected int betKOType;
|
||||
|
||||
protected JSONArray matchdayConfig;
|
||||
|
||||
@@ -25,8 +27,11 @@ public class TLWMatchesManagerBase {
|
||||
TippligaConfigProvider prov = new TippligaConfigProvider(this.season);
|
||||
JSONObject config = prov.getTippligaConfig(configFileName);
|
||||
this.numberOfMatchdays = ((Long) config.get("numberOfMatchdays")).intValue();
|
||||
try { this.matchesPerMatchday = ((Long) config.get("matchesPerMatchday")).intValue(); } catch (Exception ignored) {}
|
||||
this.matchdayConfig = (JSONArray) config.get("matchdayConfig");
|
||||
this.ko = ((Long) config.get("ko")).intValue();
|
||||
Long parsedBetKOType = (Long) config.get("betKOType");
|
||||
this.betKOType = parsedBetKOType == null ? 1 : parsedBetKOType.intValue();
|
||||
}
|
||||
|
||||
public static ArrayList<TLWMatch> getMatchesStartingFromSecondDay(ArrayList<TLWMatch> matches) {
|
||||
@@ -100,4 +105,26 @@ public class TLWMatchesManagerBase {
|
||||
date2 = date2.toLocalDate().atTime(0, 0, 0);
|
||||
return (int) date1.until(date2, ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
protected TLWMatch getMatchingMatch(APIFootballMatch apiFootballMatch, ArrayList<TLWMatch> tlwMatches) {
|
||||
TLWMatch matchingMatch = null;
|
||||
for(TLWMatch match : tlwMatches) {
|
||||
Integer apiTeamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.HOME);
|
||||
Integer apiTeamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.GUEST);
|
||||
int tlwTeamIdHome = match.getTeamIdHome();
|
||||
int tlwTeamIdGuest = match.getTeamIdGuest();
|
||||
|
||||
if(apiTeamIdHome == null
|
||||
|| apiTeamIdGuest == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
if(
|
||||
apiTeamIdHome.equals(tlwTeamIdHome)
|
||||
&& apiTeamIdGuest.equals(tlwTeamIdGuest)
|
||||
) {
|
||||
matchingMatch = match;
|
||||
}
|
||||
}
|
||||
return matchingMatch;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,34 @@
|
||||
package de.jeyp91.tippliga;
|
||||
|
||||
import de.jeyp91.StatusHolder;
|
||||
import de.jeyp91.teamidmatcher.TeamIDMatcher;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import de.jeyp91.apifootball.APIFootballMatch;
|
||||
import de.jeyp91.apifootball.APIFootballMatchesProvider;
|
||||
import de.jeyp91.teamidmatcher.TeamIDMatcher;
|
||||
import de.jeyp91.tippligaforum.TippligaSQLConnector;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import de.jeyp91.tippligaforum.TippligaWebsiteConnector;
|
||||
|
||||
import java.time.*;
|
||||
import java.util.ArrayList;
|
||||
public class TLWMatchesResultsUpdater extends TLWMatchesManagerBase {
|
||||
private static final Logger logger = LoggerFactory.getLogger(TLWMatchesResultsUpdater.class);
|
||||
|
||||
public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
private static final Logger logger = LogManager.getLogger(TLWMatchesUpdaterFootball.class);
|
||||
|
||||
ArrayList<TLWMatch> tlwMatchesOriginal;
|
||||
ArrayList<TLWMatch> tlwMatchesUpdated;
|
||||
ArrayList<ArrayList<TLWMatch>> tlwMatchesUpdated = new ArrayList<>();
|
||||
|
||||
String beautifulInfo = "";
|
||||
|
||||
public TLWMatchesUpdaterFootball(int season, int league, String configFileName) {
|
||||
public TLWMatchesResultsUpdater(int season, int league, String configFileName) {
|
||||
this.season = season;
|
||||
this.league = league;
|
||||
|
||||
tlwMatchesOriginal = new ArrayList<>();
|
||||
tlwMatchesUpdated = new ArrayList<>();
|
||||
|
||||
super.initConfigParamsFromFile(configFileName);
|
||||
this.initUpdates();
|
||||
initUpdates();
|
||||
applyUpdates();
|
||||
}
|
||||
|
||||
private void initUpdates() {
|
||||
@@ -38,9 +37,8 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
TippligaSQLConnector tippligaSQLConnector = TippligaSQLConnector.getInstance();
|
||||
for (Object singleMatchdayConfig : this.matchdayConfig) {
|
||||
int tlwMatchday = ((Long) ((JSONObject) singleMatchdayConfig).get("TLWMatchday")).intValue();
|
||||
JSONArray matchesConfig = (JSONArray) ((JSONObject) singleMatchdayConfig).get("matchesConfig");
|
||||
|
||||
ArrayList<APIFootballMatch> apiFootballMatches = apiFootballMatchesProvider.getAPIFootballMatchesFromConfig(matchesConfig);
|
||||
ArrayList<APIFootballMatch> apiFootballMatches = apiFootballMatchesProvider.getAPIFootballMatchesFromConfig((JSONObject) singleMatchdayConfig);
|
||||
|
||||
ArrayList<TLWMatch> tlwMatchesOriginalMatchday = tippligaSQLConnector.getMatches(String.valueOf(this.season), String.valueOf(this.league), String.valueOf(tlwMatchday));
|
||||
ArrayList<TLWMatch> tlwMatchesUpdatedMatchday = new ArrayList<>();
|
||||
@@ -48,204 +46,128 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
tlwMatchesUpdatedMatchday.add(new TLWMatch(match));
|
||||
}
|
||||
|
||||
if (apiFootballMatches.size() > tlwMatchesUpdatedMatchday.size()) {
|
||||
if (apiFootballMatches.size() > tlwMatchesOriginalMatchday.size()) {
|
||||
logger.error("Not matching config!");
|
||||
}
|
||||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LocalDateTime firstMatchOriginal = TLWMatchesManagerBase.getFirstMatchtimeTLW(tlwMatchesOriginalMatchday);
|
||||
LocalDateTime firstMatchUpdated = TLWMatchesManagerBase.getFirstMatchtimeAPIFootball(apiFootballMatches);
|
||||
|
||||
if(apiFootballMatches.size() > 0
|
||||
&& now.isBefore(firstMatchOriginal)
|
||||
&& now.isBefore(firstMatchUpdated)) {
|
||||
addMissingMatches(tlwMatchesUpdatedMatchday, apiFootballMatches);
|
||||
updateMatchDateTimes(tlwMatchesUpdatedMatchday, apiFootballMatches);
|
||||
updateShowTable(tlwMatchesUpdatedMatchday, apiFootballMatches);
|
||||
updateStatus(tlwMatchesUpdatedMatchday);
|
||||
if(!apiFootballMatches.isEmpty()) {
|
||||
updateResults(tlwMatchesUpdatedMatchday, apiFootballMatches);
|
||||
}
|
||||
|
||||
this.tlwMatchesOriginal.addAll(tlwMatchesOriginalMatchday);
|
||||
this.tlwMatchesUpdated.addAll(tlwMatchesUpdatedMatchday);
|
||||
updateBeautifulInfo(tlwMatchesOriginalMatchday, tlwMatchesUpdatedMatchday);
|
||||
tlwMatchesUpdatedMatchday.removeIf(tlwMatch -> tlwMatch.getUpdateStatus() != TLWMatch.COMPARISON.DIFFERENT_RESULT);
|
||||
if(!tlwMatchesUpdatedMatchday.isEmpty()) this.tlwMatchesUpdated.add(tlwMatchesUpdatedMatchday);
|
||||
}
|
||||
}
|
||||
|
||||
public String getUpdateSQL() {
|
||||
return this.getUpdateString(tlwMatchesOriginal, tlwMatchesUpdated);
|
||||
public void applyUpdates() {
|
||||
TippligaWebsiteConnector con;
|
||||
try {
|
||||
con = new TippligaWebsiteConnector();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
this.tlwMatchesUpdated.forEach(tlwMatches -> {
|
||||
con.updateResultsAdmin(this.season, this.league, tlwMatches.get(0).getMatchday(), tlwMatches);
|
||||
});
|
||||
}
|
||||
|
||||
private String getUpdateString(ArrayList<TLWMatch> matchesOriginal, ArrayList<TLWMatch> matchesUpdated) {
|
||||
String updateString = "";
|
||||
private void updateResults(
|
||||
ArrayList<TLWMatch> tlwMatchesUpdated,
|
||||
ArrayList<APIFootballMatch> apiFootballMatches)
|
||||
{
|
||||
ArrayList<TLWMatch> tlwMatchesCopy = new ArrayList<>(tlwMatchesUpdated);
|
||||
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
|
||||
try {
|
||||
TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatchesCopy);
|
||||
tlwMatchesCopy.remove(tlwMatch);
|
||||
if(Objects.equals(apiFootballMatch.getStatus(), TLWMatch.STATUS_FINISHED)) {
|
||||
if(!Objects.equals(tlwMatch.getGoalsHome(), apiFootballMatch.getGoalsHome())
|
||||
|| !Objects.equals(tlwMatch.getGoalsGuest(), apiFootballMatch.getGoalsGuest())
|
||||
) {
|
||||
tlwMatch.setGoalsHome(apiFootballMatch.getGoalsHome());
|
||||
tlwMatch.setGoalsGuest(apiFootballMatch.getGoalsGuest());
|
||||
tlwMatch.setUpdateStatus(TLWMatch.COMPARISON.DIFFERENT_RESULT);
|
||||
}
|
||||
if(tlwMatch.getKoMatch() &&
|
||||
this.betKOType == 2 &&
|
||||
(!Objects.equals(tlwMatch.getGoalsOvertimeHome(), apiFootballMatch.getGoalsOvertimeHome())
|
||||
|| !Objects.equals(tlwMatch.getGoalsOvertimeGuest(), apiFootballMatch.getGoalsOvertimeGuest()))
|
||||
) {
|
||||
tlwMatch.setGoalsOvertimeHome(apiFootballMatch.getGoalsOvertimeHome());
|
||||
tlwMatch.setGoalsOvertimeGuest(apiFootballMatch.getGoalsOvertimeGuest());
|
||||
tlwMatch.setUpdateStatus(TLWMatch.COMPARISON.DIFFERENT_RESULT);
|
||||
}
|
||||
if(tlwMatch.getKoMatch() &&
|
||||
(this.betKOType == 1 || this.betKOType == 3) &&
|
||||
(apiFootballMatch.getGoalsPenaltyHome() != null) &&
|
||||
(!Objects.equals(tlwMatch.getGoalsOvertimeHome(), apiFootballMatch.getGoalsPenaltyHome())
|
||||
|| !Objects.equals(tlwMatch.getGoalsOvertimeGuest(), apiFootballMatch.getGoalsPenaltyGuest()))
|
||||
) {
|
||||
tlwMatch.setGoalsOvertimeHome(apiFootballMatch.getGoalsPenaltyHome());
|
||||
tlwMatch.setGoalsOvertimeGuest(apiFootballMatch.getGoalsPenaltyGuest());
|
||||
tlwMatch.setUpdateStatus(TLWMatch.COMPARISON.DIFFERENT_RESULT);
|
||||
}
|
||||
if(tlwMatch.getKoMatch() &&
|
||||
(this.betKOType == 1 || this.betKOType == 3) &&
|
||||
(apiFootballMatch.getGoalsPenaltyHome() == null) &&
|
||||
(!Objects.equals(tlwMatch.getGoalsOvertimeHome(), apiFootballMatch.getGoalsOvertimeHome())
|
||||
|| !Objects.equals(tlwMatch.getGoalsOvertimeGuest(), apiFootballMatch.getGoalsOvertimeGuest()))
|
||||
) {
|
||||
tlwMatch.setGoalsOvertimeHome(apiFootballMatch.getGoalsOvertimeHome());
|
||||
tlwMatch.setGoalsOvertimeGuest(apiFootballMatch.getGoalsOvertimeGuest());
|
||||
tlwMatch.setUpdateStatus(TLWMatch.COMPARISON.DIFFERENT_RESULT);
|
||||
}
|
||||
if(Objects.equals(tlwMatch.getStatus(), TLWMatch.STATUS_PROVISIONAL_RESULT_AVAILABLE)) {
|
||||
tlwMatch.setUpdateStatus(TLWMatch.COMPARISON.DIFFERENT_RESULT);
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateBeautifulInfo(ArrayList<TLWMatch> matchesOriginal, ArrayList<TLWMatch> matchesUpdated) {
|
||||
for (int i = 0; i < matchesOriginal.size(); i++) {
|
||||
updateString += getUpdateString(matchesOriginal.get(i), matchesUpdated.get(i));
|
||||
if(matchesUpdated.get(i).getUpdateStatus() != TLWMatch.COMPARISON.DIFFERENT_RESULT) {
|
||||
continue;
|
||||
}
|
||||
updateBeautifulInfo(matchesOriginal.get(i), matchesUpdated.get(i));
|
||||
}
|
||||
return updateString;
|
||||
}
|
||||
|
||||
private String getUpdateString(TLWMatch matchOriginal, TLWMatch matchUpdated) {
|
||||
String updateString = "";
|
||||
String updateStart = "UPDATE phpbb_footb_matches SET ";
|
||||
String condition = "WHERE season = " + matchOriginal.getSeason() + " " +
|
||||
"AND league = " + matchOriginal.getLeague() + " " +
|
||||
"AND matchday = " + matchOriginal.getMatchday() + " " +
|
||||
"AND match_no = " + matchOriginal.getMatchNo() + ";\n";
|
||||
private void updateBeautifulInfo(TLWMatch matchOriginal, TLWMatch matchUpdated) {
|
||||
String beautifulInfoStart = "Aktualisiere Saison " + matchOriginal.getSeason() + ", " +
|
||||
"Liga " + matchOriginal.getLeague() + ", " +
|
||||
"Spieltag " + matchOriginal.getMatchday() + ", " +
|
||||
"Spielnummer " + matchOriginal.getMatchNo() + ", " +
|
||||
"Spiel '" + TeamIDMatcher.getTeamNameFromTippligaId(matchOriginal.getTeamIdHome()) + "' - '" + TeamIDMatcher.getTeamNameFromTippligaId(matchOriginal.getTeamIdGuest()) + "', ";
|
||||
|
||||
if(!matchOriginal.getTeamIdHome().equals(matchUpdated.getTeamIdHome())) {
|
||||
updateString += updateStart +
|
||||
"team_id_home = " + matchUpdated.getTeamIdHome() + " " +
|
||||
condition;
|
||||
if(!Objects.equals(matchOriginal.getGoalsHome(), matchUpdated.getGoalsHome())
|
||||
|| !Objects.equals(matchOriginal.getGoalsGuest(), matchUpdated.getGoalsGuest())) {
|
||||
this.beautifulInfo += beautifulInfoStart +
|
||||
"Heimteam zu '" + matchUpdated.getTeamNameHome() + "'.\n";
|
||||
"Ergebnis zu '" + matchUpdated.getGoalsHome() + ":" + matchUpdated.getGoalsGuest() + "'.\n";
|
||||
}
|
||||
|
||||
if(!matchOriginal.getTeamIdGuest().equals(matchUpdated.getTeamIdGuest())) {
|
||||
updateString += updateStart +
|
||||
"team_id_guest = " + matchUpdated.getTeamIdGuest() + " " +
|
||||
condition;
|
||||
if(matchOriginal.getKoMatch() && (!Objects.equals(matchOriginal.getGoalsOvertimeHome(), matchUpdated.getGoalsOvertimeHome())
|
||||
|| !Objects.equals(matchOriginal.getGoalsOvertimeGuest(), matchUpdated.getGoalsOvertimeGuest()))) {
|
||||
this.beautifulInfo += beautifulInfoStart +
|
||||
"Gastteam zu '" + matchUpdated.getTeamNameGuest() + "'.\n";
|
||||
"Ergebnis Nachspielzeit zu '" + matchUpdated.getGoalsOvertimeHome() + ":" + matchUpdated.getGoalsOvertimeGuest() + "'.\n";
|
||||
}
|
||||
|
||||
if (!matchOriginal.getMatchDateTime().equals(matchUpdated.getMatchDateTime())) {
|
||||
updateString += updateStart +
|
||||
"match_datetime = '" + matchUpdated.getMatchDateTime() + "' " +
|
||||
condition;
|
||||
if(matchOriginal.getStatus().equals(TLWMatch.STATUS_PROVISIONAL_RESULT_AVAILABLE)
|
||||
&& Objects.equals(matchOriginal.getGoalsHome(), matchUpdated.getGoalsHome())
|
||||
&& Objects.equals(matchOriginal.getGoalsGuest(), matchUpdated.getGoalsGuest())
|
||||
&& (!matchOriginal.getKoMatch() || (
|
||||
matchOriginal.getKoMatch()
|
||||
&& Objects.equals(matchOriginal.getGoalsOvertimeHome(), matchUpdated.getGoalsOvertimeHome())
|
||||
&& Objects.equals(matchOriginal.getGoalsOvertimeGuest(), matchUpdated.getGoalsOvertimeGuest())
|
||||
))
|
||||
) {
|
||||
this.beautifulInfo += beautifulInfoStart +
|
||||
"Spielbeginn zu '" + matchUpdated.getMatchDateTime() + "'.\n";
|
||||
"Ergebnis gespeichert.\n";
|
||||
}
|
||||
|
||||
if (!matchOriginal.getStatus().equals(matchUpdated.getStatus())) {
|
||||
updateString += updateStart +
|
||||
"status = '" + matchUpdated.getStatus() + "' " +
|
||||
condition;
|
||||
this.beautifulInfo += beautifulInfoStart +
|
||||
"Status zu '" + matchUpdated.getStatus() + "'.\n";
|
||||
}
|
||||
|
||||
if (!matchOriginal.getShowTable().equals(matchUpdated.getShowTable())) {
|
||||
updateString += updateStart +
|
||||
"show_table = '" + matchUpdated.getShowTable() + "' " +
|
||||
condition;
|
||||
this.beautifulInfo += beautifulInfoStart +
|
||||
"Spiel in Tabelle einberechnen zu '" + (matchUpdated.getShowTable() == 1 ? "falsch" : "wahr") + "'.\n";
|
||||
}
|
||||
|
||||
|
||||
return updateString;
|
||||
}
|
||||
|
||||
private void addMissingMatches(ArrayList<TLWMatch> tlwMatches,
|
||||
ArrayList<APIFootballMatch> apiFootballMatches) {
|
||||
|
||||
ArrayList<APIFootballMatch> missingMatches = new ArrayList<>();
|
||||
|
||||
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
|
||||
try {
|
||||
if(getMatchingMatch(apiFootballMatch, tlwMatches) == null) {
|
||||
missingMatches.add(apiFootballMatch);
|
||||
}
|
||||
} catch (NullPointerException ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (APIFootballMatch missingMatch : missingMatches) {
|
||||
boolean done = false;
|
||||
for(TLWMatch tlwMatch : tlwMatches) {
|
||||
if(tlwMatch.getTeamIdHome() == 0 && tlwMatch.getTeamIdGuest() == 0) {
|
||||
tlwMatch.updateMatch(missingMatch);
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!done) {
|
||||
logger.error("Could not add missing match: " + this.season + ", " + this.league + ", " + tlwMatches.get(0).getMatchday() + ", " + missingMatch.getTeamNameHome() + " - " + missingMatch.getTeamNameGuest());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateMatchDateTimes(
|
||||
ArrayList<TLWMatch> tlwMatches,
|
||||
ArrayList<APIFootballMatch> apiFootballMatches)
|
||||
{
|
||||
ArrayList<TLWMatch> tlwMatchesCopy = new ArrayList<>(tlwMatches);
|
||||
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
|
||||
try {
|
||||
TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatchesCopy);
|
||||
tlwMatchesCopy.remove(tlwMatch);
|
||||
if(tlwMatch == null) {
|
||||
StatusHolder.setError();
|
||||
logger.error("Did not find match to update: " + this.season + ", " + this.league + ", " + tlwMatches.get(0).getMatchday() + ", " + apiFootballMatch.getTeamNameHome() + " - " + apiFootballMatch.getTeamNameGuest());
|
||||
}
|
||||
tlwMatch.setMatchDateTime(apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19));
|
||||
} catch(NullPointerException ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateStatus(ArrayList<TLWMatch> matches) {
|
||||
LocalDateTime earliestDate = TLWMatchesManagerBase.getFirstMatchtimeTLW(matches);
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
if(earliestDate.isAfter(now)) {
|
||||
for(TLWMatch match : matches) {
|
||||
LocalDateTime date = TLWMatchesManagerBase.getDate(match);
|
||||
if (getDaysDifference(earliestDate, date) == 0) {
|
||||
match.setStatus(0);
|
||||
} else {
|
||||
match.setStatus(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateShowTable(
|
||||
ArrayList<TLWMatch> tlwMatches,
|
||||
ArrayList<APIFootballMatch> apiFootballMatches)
|
||||
{
|
||||
ArrayList<TLWMatch> tlwMatchesCopy = new ArrayList<>(tlwMatches);
|
||||
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
|
||||
try {
|
||||
TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatchesCopy);
|
||||
tlwMatchesCopy.remove(tlwMatch);
|
||||
tlwMatch.setShowTable(apiFootballMatch.getShowTable());
|
||||
} catch (NullPointerException ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private TLWMatch getMatchingMatch(APIFootballMatch apiFootballMatch, ArrayList<TLWMatch> tlwMatches) throws NullPointerException{
|
||||
int foundMatches = 0;
|
||||
TLWMatch matchingMatch = null;
|
||||
for(TLWMatch match : tlwMatches) {
|
||||
Integer apiTeamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.HOME);
|
||||
Integer apiTeamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.GUEST);
|
||||
int tlwTeamIdHome = match.getTeamIdHome();
|
||||
int tlwTeamIdGuest = match.getTeamIdGuest();
|
||||
|
||||
if(apiTeamIdHome == null
|
||||
|| apiTeamIdGuest == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
if(
|
||||
apiTeamIdHome.equals(tlwTeamIdHome)
|
||||
&& apiTeamIdGuest.equals(tlwTeamIdGuest)
|
||||
) {
|
||||
foundMatches++;
|
||||
matchingMatch = match;
|
||||
}
|
||||
}
|
||||
return matchingMatch;
|
||||
}
|
||||
|
||||
public ArrayList<TLWMatch> getTLWMatchesUpdated() {
|
||||
return this.tlwMatchesUpdated;
|
||||
}
|
||||
|
||||
public String getBeautifulInfo() {
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
package de.jeyp91.tippliga;
|
||||
|
||||
import de.jeyp91.StatusHolder;
|
||||
import de.jeyp91.teamidmatcher.TeamIDMatcher;
|
||||
import de.jeyp91.apifootball.APIFootballMatch;
|
||||
import de.jeyp91.apifootball.APIFootballMatchesProvider;
|
||||
import de.jeyp91.tippligaforum.TippligaSQLConnector;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.time.*;
|
||||
import java.util.ArrayList;
|
||||
import de.jeyp91.StatusHolder;
|
||||
import de.jeyp91.apifootball.APIFootballMatch;
|
||||
import de.jeyp91.apifootball.APIFootballMatchesProvider;
|
||||
import de.jeyp91.teamidmatcher.TeamIDMatcher;
|
||||
import de.jeyp91.tippligaforum.TippligaSQLConnector;
|
||||
|
||||
public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
private static final Logger logger = LogManager.getLogger(TLWMatchesUpdaterFootball.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(TLWMatchesUpdaterFootball.class);
|
||||
|
||||
ArrayList<TLWMatch> tlwMatchesOriginal;
|
||||
ArrayList<TLWMatch> tlwMatchesUpdated;
|
||||
@@ -38,9 +41,8 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
TippligaSQLConnector tippligaSQLConnector = TippligaSQLConnector.getInstance();
|
||||
for (Object singleMatchdayConfig : this.matchdayConfig) {
|
||||
int tlwMatchday = ((Long) ((JSONObject) singleMatchdayConfig).get("TLWMatchday")).intValue();
|
||||
JSONArray matchesConfig = (JSONArray) ((JSONObject) singleMatchdayConfig).get("matchesConfig");
|
||||
|
||||
ArrayList<APIFootballMatch> apiFootballMatches = apiFootballMatchesProvider.getAPIFootballMatchesFromConfig(matchesConfig);
|
||||
ArrayList<APIFootballMatch> apiFootballMatches = apiFootballMatchesProvider.getAPIFootballMatchesFromConfig((JSONObject) singleMatchdayConfig);
|
||||
|
||||
ArrayList<TLWMatch> tlwMatchesOriginalMatchday = tippligaSQLConnector.getMatches(String.valueOf(this.season), String.valueOf(this.league), String.valueOf(tlwMatchday));
|
||||
ArrayList<TLWMatch> tlwMatchesUpdatedMatchday = new ArrayList<>();
|
||||
@@ -64,6 +66,10 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
updateShowTable(tlwMatchesUpdatedMatchday, apiFootballMatches);
|
||||
updateStatus(tlwMatchesUpdatedMatchday);
|
||||
}
|
||||
if(now.isBefore(firstMatchOriginal)) {
|
||||
updateStatus(tlwMatchesUpdatedMatchday);
|
||||
addPlaceholderMatches(tlwMatchesUpdatedMatchday, (JSONObject) singleMatchdayConfig);
|
||||
}
|
||||
|
||||
this.tlwMatchesOriginal.addAll(tlwMatchesOriginalMatchday);
|
||||
this.tlwMatchesUpdated.addAll(tlwMatchesUpdatedMatchday);
|
||||
@@ -135,6 +141,14 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
"Spiel in Tabelle einberechnen zu '" + (matchUpdated.getShowTable() == 1 ? "falsch" : "wahr") + "'.\n";
|
||||
}
|
||||
|
||||
if (!matchOriginal.getKoMatch().equals(matchUpdated.getKoMatch())) {
|
||||
updateString += updateStart +
|
||||
"ko_match = '" + (matchUpdated.getKoMatch() ? "1" : "0") + "' " +
|
||||
condition;
|
||||
this.beautifulInfo += beautifulInfoStart +
|
||||
"KO zu '" + (matchUpdated.getKoMatch() ? "wahr" : "falsch") + "'.\n";
|
||||
}
|
||||
|
||||
|
||||
return updateString;
|
||||
}
|
||||
@@ -145,30 +159,83 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
ArrayList<APIFootballMatch> missingMatches = new ArrayList<>();
|
||||
|
||||
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
|
||||
try {
|
||||
if(getMatchingMatch(apiFootballMatch, tlwMatches) == null) {
|
||||
missingMatches.add(apiFootballMatch);
|
||||
}
|
||||
} catch (NullPointerException ignored) {
|
||||
|
||||
if(getMatchingMatch(apiFootballMatch, tlwMatches) == null) {
|
||||
missingMatches.add(apiFootballMatch);
|
||||
}
|
||||
}
|
||||
|
||||
for (APIFootballMatch missingMatch : missingMatches) {
|
||||
boolean done = false;
|
||||
for(TLWMatch tlwMatch : tlwMatches) {
|
||||
if(tlwMatch.getTeamIdHome() == 0 && tlwMatch.getTeamIdGuest() == 0) {
|
||||
// update placeholder match based on matching match datetime
|
||||
for (TLWMatch tlwMatch : tlwMatches) {
|
||||
if ( tlwMatch.getTeamIdHome() == 0 && tlwMatch.getTeamIdGuest() == 0
|
||||
&& Objects.equals(tlwMatch.getMatchDateTime(), missingMatch.getMatchDateTime().replace("T", " ").substring(0, 19))
|
||||
&& !Objects.equals(tlwMatch.getFormulaHome(), "")
|
||||
&& !Objects.equals(tlwMatch.getFormulaGuest(), "")) {
|
||||
tlwMatch.updateMatch(missingMatch);
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// update empty match
|
||||
if(!done) {
|
||||
for (TLWMatch tlwMatch : tlwMatches) {
|
||||
if (tlwMatch.getTeamIdHome() == 0 && tlwMatch.getTeamIdGuest() == 0
|
||||
&& (Objects.equals(tlwMatch.getFormulaHome(), "") || Objects.equals(tlwMatch.getFormulaHome(), "D"))
|
||||
&& (Objects.equals(tlwMatch.getFormulaGuest(), "") || Objects.equals(tlwMatch.getFormulaGuest(), "D"))
|
||||
) {
|
||||
tlwMatch.updateMatch(missingMatch);
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!done) {
|
||||
logger.error("Could not add missing match: " + this.season + ", " + this.league + ", " + tlwMatches.get(0).getMatchday() + ", " + missingMatch.getTeamNameHome() + " - " + missingMatch.getTeamNameGuest());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addPlaceholderMatches(ArrayList<TLWMatch> tlwMatches,
|
||||
JSONObject matchdayConfig) {
|
||||
Integer numberOfMatches = this.matchesPerMatchday;
|
||||
try { numberOfMatches = ((Long) matchdayConfig.get("numberOfMatches")).intValue();} catch (Exception ignored) {}
|
||||
ArrayList<TLWMatch> placeholderMatches = new ArrayList<>();
|
||||
ArrayList<TLWMatch> tlwMatchesCopy = new ArrayList<>(tlwMatches);
|
||||
JSONArray matchesConfig = (JSONArray) matchdayConfig.get("matchesConfig");
|
||||
for (Object singleMatchConfig : matchesConfig) {
|
||||
// check if type placeholderSingleMatch
|
||||
if(((JSONObject) singleMatchConfig).get("type").equals("PlaceholderSingleMatch")) {
|
||||
String formulaHome = (String) ((JSONObject) singleMatchConfig).get("formulaHome");
|
||||
String formulaGuest = (String) ((JSONObject) singleMatchConfig).get("formulaGuest");
|
||||
String matchDateTime = (String) ((JSONObject) singleMatchConfig).get("placeholderDatetime");
|
||||
TLWMatch placeholderMatch = new TLWMatch(formulaHome, formulaGuest, matchDateTime);
|
||||
placeholderMatches.add(placeholderMatch);
|
||||
}
|
||||
}
|
||||
// filter placeholderMatches by checking if they are already in tlwMatches
|
||||
Iterator<TLWMatch> placeholderIterator = placeholderMatches.iterator();
|
||||
while (placeholderIterator.hasNext()) {
|
||||
TLWMatch placeholderMatch = placeholderIterator.next();
|
||||
Iterator<TLWMatch> tlwMatchIterator = tlwMatchesCopy.iterator();
|
||||
while (tlwMatchIterator.hasNext()) {
|
||||
TLWMatch tlwMatch = tlwMatchIterator.next();
|
||||
if (TLWMatch.isSameMatchPlaceholder(tlwMatch, placeholderMatch)) {
|
||||
tlwMatchIterator.remove();
|
||||
placeholderIterator.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// check if total number of matches is not too high
|
||||
if(tlwMatches.size() + placeholderMatches.size() > (numberOfMatches)) {
|
||||
logger.error("Too many matches in config: " + this.season + ", " + this.league + ", " + tlwMatches.get(0).getMatchday());
|
||||
} else {
|
||||
// add placeholderMatches to tlwMatches
|
||||
tlwMatches.addAll(placeholderMatches);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateMatchDateTimes(
|
||||
ArrayList<TLWMatch> tlwMatches,
|
||||
ArrayList<APIFootballMatch> apiFootballMatches)
|
||||
@@ -195,10 +262,13 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
if(earliestDate.isAfter(now)) {
|
||||
for(TLWMatch match : matches) {
|
||||
LocalDateTime date = TLWMatchesManagerBase.getDate(match);
|
||||
if (getDaysDifference(earliestDate, date) == 0) {
|
||||
int daysDifference = TLWMatchesManagerBase.getDaysDifference(earliestDate, date);
|
||||
if (daysDifference == 0) {
|
||||
match.setStatus(0);
|
||||
} else {
|
||||
} else if (daysDifference > 0 && daysDifference < 7) {
|
||||
match.setStatus(-1);
|
||||
} else {
|
||||
match.setStatus(-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,36 +282,31 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
|
||||
try {
|
||||
TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatchesCopy);
|
||||
if(tlwMatch.getTeamIdHome() == 4) {
|
||||
int debug = 1;
|
||||
}
|
||||
tlwMatchesCopy.remove(tlwMatch);
|
||||
tlwMatch.setShowTable(apiFootballMatch.getShowTable());
|
||||
tlwMatch.setShowTable(apiFootballMatch.getShowTable() == 0);
|
||||
} catch (NullPointerException ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private TLWMatch getMatchingMatch(APIFootballMatch apiFootballMatch, ArrayList<TLWMatch> tlwMatches) throws NullPointerException{
|
||||
int foundMatches = 0;
|
||||
TLWMatch matchingMatch = null;
|
||||
for(TLWMatch match : tlwMatches) {
|
||||
Integer apiTeamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.HOME);
|
||||
Integer apiTeamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.GUEST);
|
||||
int tlwTeamIdHome = match.getTeamIdHome();
|
||||
int tlwTeamIdGuest = match.getTeamIdGuest();
|
||||
private void updateKo(
|
||||
ArrayList<TLWMatch> tlwMatches,
|
||||
ArrayList<APIFootballMatch> apiFootballMatches)
|
||||
{
|
||||
ArrayList<TLWMatch> tlwMatchesCopy = new ArrayList<>(tlwMatches);
|
||||
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
|
||||
try {
|
||||
TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatchesCopy);
|
||||
tlwMatchesCopy.remove(tlwMatch);
|
||||
tlwMatch.setKoMatch(apiFootballMatch.getKoMatch());
|
||||
} catch (NullPointerException ignored) {
|
||||
|
||||
if(apiTeamIdHome == null
|
||||
|| apiTeamIdGuest == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
if(
|
||||
apiTeamIdHome.equals(tlwTeamIdHome)
|
||||
&& apiTeamIdGuest.equals(tlwTeamIdGuest)
|
||||
) {
|
||||
foundMatches++;
|
||||
matchingMatch = match;
|
||||
}
|
||||
}
|
||||
return matchingMatch;
|
||||
}
|
||||
|
||||
public ArrayList<TLWMatch> getTLWMatchesUpdated() {
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package de.jeyp91.tippliga;
|
||||
|
||||
import de.jeyp91.tippligaforum.TippligaSQLConnector;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class TLWTeamsCreator {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TLWTeamsCreator.class);
|
||||
int season;
|
||||
int league;
|
||||
ArrayList<TLWMatch> matches;
|
||||
@@ -36,6 +40,10 @@ public class TLWTeamsCreator {
|
||||
String sql = "";
|
||||
for (Integer id : teamIds) {
|
||||
ArrayList<TLWTeam> teams = connector.getTeams(String.valueOf(id));
|
||||
if(teams.size() == 0) {
|
||||
this.logger.error("Did not find team id " + id.toString());
|
||||
continue;
|
||||
}
|
||||
String teamName = teams.get(0).getTeamName();
|
||||
String teamNameShort = teams.get(0).getTeamNameShort();
|
||||
String teamSymbol = teams.get(0).getTeamSymbol();
|
||||
|
||||
@@ -1,22 +1,35 @@
|
||||
package de.jeyp91.tippligaforum;
|
||||
|
||||
import com.google.gson.*;
|
||||
import de.jeyp91.S3Provider;
|
||||
import de.jeyp91.apifootball.APIFootballMatch;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import de.jeyp91.S3Provider;
|
||||
import de.jeyp91.apifootball.APIFootballMatch;
|
||||
|
||||
public class MatchesListCreator {
|
||||
|
||||
private final JSONObject mainObject = new JSONObject();
|
||||
private final String country;
|
||||
private final String leagueName;
|
||||
private String country;
|
||||
private String leagueName;
|
||||
private final int season;
|
||||
|
||||
public MatchesListCreator(int league) {
|
||||
public MatchesListCreator(int season, int league) {
|
||||
this.season = season;
|
||||
S3Provider prov = new S3Provider();
|
||||
JSONObject leagueConfig = prov.getFixturesJSONFromS3(league);
|
||||
JSONObject api = (JSONObject) leagueConfig.get("api");
|
||||
JSONArray matchesAPIFootball = (JSONArray) api.get("fixtures");
|
||||
JSONObject leagueConfig = prov.getFixturesJSONFromS3(season, league);
|
||||
if (leagueConfig == null) {
|
||||
return;
|
||||
}
|
||||
JSONArray matchesAPIFootball = (JSONArray) leagueConfig.get("response");
|
||||
|
||||
if(matchesAPIFootball.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
JSONObject firstMatchAPIFootball = (JSONObject) matchesAPIFootball.get(0);
|
||||
JSONObject leagueObject = (JSONObject) firstMatchAPIFootball.get("league");
|
||||
@@ -40,16 +53,20 @@ public class MatchesListCreator {
|
||||
JSONObject matchAPIFootball = (JSONObject) matchAPIFootballObject;
|
||||
JSONObject match = new JSONObject();
|
||||
|
||||
Long leagueId = (Long) matchAPIFootball.get("league_id");
|
||||
String matchdayString = matchAPIFootball.get("round").toString();
|
||||
int matchday = APIFootballMatch.getMatchdayFromRoundString(2021, matchdayString, leagueId.intValue());
|
||||
String matchtime = matchAPIFootball.get("event_date").toString().replace("T", " ").substring(0, 16);
|
||||
Long fixtureId = (Long) matchAPIFootball.get("fixture_id");
|
||||
JSONObject leagueObject = (JSONObject) matchAPIFootball.get("league");
|
||||
Long leagueId = (Long) leagueObject.get("id");
|
||||
String matchdayString = leagueObject.get("round").toString();
|
||||
int matchday = APIFootballMatch.getMatchdayFromRoundString(this.season, matchdayString, leagueId.intValue());
|
||||
|
||||
JSONObject teamHome = (JSONObject) matchAPIFootball.get("homeTeam");
|
||||
String teamNameHome = teamHome.get("team_name").toString();
|
||||
JSONObject teamGuest = (JSONObject) matchAPIFootball.get("awayTeam");
|
||||
String teamNameGuest = teamGuest.get("team_name").toString();
|
||||
JSONObject fixtureObject = (JSONObject) matchAPIFootball.get("fixture");
|
||||
String matchtime = fixtureObject.get("date").toString().replace("T", " ").substring(0, 16);
|
||||
Long fixtureId = (Long) fixtureObject.get("id");
|
||||
|
||||
JSONObject teamsObject = (JSONObject) matchAPIFootball.get("teams");
|
||||
JSONObject teamHome = (JSONObject) teamsObject.get("home");
|
||||
String teamNameHome = teamHome.get("name").toString();
|
||||
JSONObject teamGuest = (JSONObject) teamsObject.get("away");
|
||||
String teamNameGuest = teamGuest.get("name").toString();
|
||||
|
||||
match.put("match", teamNameHome + " - " + teamNameGuest);
|
||||
match.put("matchday", matchday);
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package de.jeyp91.tippligaforum;
|
||||
|
||||
import de.jeyp91.App;
|
||||
import de.jeyp91.apifootball.APIFootballUpdater;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import de.jeyp91.apifootball.APIFootballUpdater;
|
||||
|
||||
public class MatchesListForumUpdater {
|
||||
private HashSet<Integer> leagues;
|
||||
private static final Logger logger = LogManager.getLogger(MatchesListForumUpdater.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(MatchesListForumUpdater.class);
|
||||
|
||||
public MatchesListForumUpdater(int season) {
|
||||
this.leagues = new APIFootballUpdater().getLeagues(season);
|
||||
public MatchesListForumUpdater() {
|
||||
this.leagues = new APIFootballUpdater().getLeagues();
|
||||
}
|
||||
|
||||
public void updateAllLeagues(int season) {
|
||||
@@ -24,7 +24,10 @@ public class MatchesListForumUpdater {
|
||||
}
|
||||
|
||||
public void updateLeague(int season, int league) {
|
||||
MatchesListCreator creator = new MatchesListCreator(league);
|
||||
MatchesListCreator creator = new MatchesListCreator(season, league);
|
||||
if(creator.getMatches().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String content = creator.getMatchesBeautiful();
|
||||
String contentWithCodeBBCode = "<r><CODE><s>[code]</s>" + content + "<e>[/code]</e></CODE></r>";
|
||||
Integer postId = getPostId(season, creator.getCountry(), creator.getLeagueName());
|
||||
|
||||
@@ -1,28 +1,32 @@
|
||||
package de.jeyp91.tippligaforum;
|
||||
|
||||
import de.jeyp91.StatusHolder;
|
||||
import de.jeyp91.tippliga.TLWMatch;
|
||||
import de.jeyp91.tippliga.TLWMatchday;
|
||||
import de.jeyp91.tippliga.TLWTeam;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import de.jeyp91.StatusHolder;
|
||||
import de.jeyp91.tippliga.TLWLeague;
|
||||
import de.jeyp91.tippliga.TLWMatch;
|
||||
import de.jeyp91.tippliga.TLWMatchday;
|
||||
import de.jeyp91.tippliga.TLWTeam;
|
||||
import de.jeyp91.whatsapp.WhatsAppReminder;
|
||||
|
||||
public class TippligaSQLConnector {
|
||||
|
||||
Connection con;
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(TippligaSQLConnector.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(TippligaSQLConnector.class);
|
||||
private static TippligaSQLConnector tlwSqlCon = null;
|
||||
|
||||
static {
|
||||
@@ -35,6 +39,8 @@ public class TippligaSQLConnector {
|
||||
}
|
||||
|
||||
private TippligaSQLConnector() {
|
||||
String databaseUsername = System.getenv("TLW_DATABASE_USERNAME");
|
||||
String databasePassword = System.getenv("TLW_DATABASE_PASSWORD");
|
||||
String jdbcUrlLocalhost = "jdbc:mysql://localhost:3306/d0144ddb" +
|
||||
"?user=root" +
|
||||
"&password=" +
|
||||
@@ -44,8 +50,8 @@ public class TippligaSQLConnector {
|
||||
"&serverTimezone=UTC" +
|
||||
"&allowMultiQueries=true";
|
||||
String jdbcUrlProd = "jdbc:mysql://w00f4eaf.kasserver.com:3306/d0144ddb" +
|
||||
"?user=d0144ddb" +
|
||||
"&password=TippligaWuerzb_1" +
|
||||
"?user=" + databaseUsername +
|
||||
"&password=" + databasePassword +
|
||||
"&useUnicode=true" +
|
||||
"&useJDBCCompliantTimezoneShift=true" +
|
||||
"&useLegacyDatetimeCode=false" +
|
||||
@@ -61,7 +67,7 @@ public class TippligaSQLConnector {
|
||||
}
|
||||
|
||||
public static TippligaSQLConnector getInstance() {
|
||||
if(tlwSqlCon == null) {
|
||||
if (tlwSqlCon == null) {
|
||||
tlwSqlCon = new TippligaSQLConnector();
|
||||
}
|
||||
return tlwSqlCon;
|
||||
@@ -138,6 +144,66 @@ public class TippligaSQLConnector {
|
||||
return matchdays;
|
||||
}
|
||||
|
||||
public TLWLeague getLeague(String season, String league) {
|
||||
String queryString = "SELECT * FROM `phpbb_footb_leagues` WHERE `season` = " + season + " AND `league` = " + league + ";";
|
||||
ResultSet rset = executeQuery(queryString);
|
||||
TLWLeague tlwLeague = null;
|
||||
try {
|
||||
while (rset.next()) {
|
||||
tlwLeague = new TLWLeague(rset);
|
||||
}
|
||||
} catch (SQLException throwables) {
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
return tlwLeague;
|
||||
}
|
||||
|
||||
public ArrayList<TLWMatchday> getUpdatedMatchdaysBasedOnMatches(String season, String league) {
|
||||
String queryString = """
|
||||
SELECT
|
||||
d1.season,
|
||||
d1.league,
|
||||
d1.matchday,
|
||||
d1.status,
|
||||
d1.delivery_date,
|
||||
min(STR_TO_DATE(d2.match_datetime, '%Y-%m-%d %H:%i:%s')) as delivery_date_2,
|
||||
min(STR_TO_DATE(d3.match_datetime, '%Y-%m-%d %H:%i:%s')) as delivery_date_3,
|
||||
d1.matchday_name,
|
||||
d1.matches
|
||||
FROM (
|
||||
SELECT
|
||||
md.season,
|
||||
md.league,
|
||||
md.matchday,
|
||||
md.status,
|
||||
min(STR_TO_DATE(ma.match_datetime, '%Y-%m-%d %H:%i:%s')) AS delivery_date,
|
||||
md.matchday_name,
|
||||
md.matches
|
||||
FROM phpbb_footb_matchdays md
|
||||
LEFT JOIN phpbb_footb_matches ma ON (md.season = ma.season AND md.league = ma.league AND md.matchday = ma.matchday)
|
||||
WHERE md.season =""" + " " + season + " " + """
|
||||
AND md.league =""" + " " + league + " " + """
|
||||
GROUP BY md.season, md.league, md.matchday
|
||||
) AS d1
|
||||
LEFT JOIN phpbb_footb_matches d2 ON (d1.season = d2.season AND d1.league = d2.league AND d1.matchday = d2.matchday
|
||||
AND DATEDIFF(DATE(STR_TO_DATE(d2.match_datetime, '%Y-%m-%d %H:%i:%s')), DATE(d1.delivery_date)) > 0)
|
||||
LEFT JOIN phpbb_footb_matches d3 ON (d1.season = d3.season AND d1.league = d3.league AND d1.matchday = d3.matchday
|
||||
AND DATEDIFF(DATE(STR_TO_DATE(d3.match_datetime, '%Y-%m-%d %H:%i:%s')), DATE(d1.delivery_date)) > 6)
|
||||
GROUP BY d1.season, d1.league, d1.matchday;
|
||||
""";
|
||||
|
||||
ArrayList<TLWMatchday> matchdays = new ArrayList<>();
|
||||
ResultSet rset = executeQuery(queryString);
|
||||
try {
|
||||
while (rset.next()) {
|
||||
matchdays.add(new TLWMatchday(rset));
|
||||
}
|
||||
} catch (SQLException throwables) {
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
return matchdays;
|
||||
}
|
||||
|
||||
public Integer getForumId(String forumName, int parentId) {
|
||||
String queryString = "SELECT forum_id FROM phpbb_forums WHERE forum_name = \"" + forumName + "\" AND parent_id = " + parentId + ";";
|
||||
ResultSet rset = executeQuery(queryString);
|
||||
@@ -180,19 +246,19 @@ public class TippligaSQLConnector {
|
||||
return post;
|
||||
}
|
||||
|
||||
public ResultSet executeQuery (String queryString){
|
||||
public ResultSet executeQuery(String queryString) {
|
||||
Statement stmt;
|
||||
ResultSet rset = null;
|
||||
try {
|
||||
stmt = con.createStatement();
|
||||
rset = stmt.executeQuery(queryString);
|
||||
} catch (SQLException e) {
|
||||
logger.error(e.getStackTrace());
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
return rset;
|
||||
}
|
||||
|
||||
public void executeUpdate (String queryString){
|
||||
public void executeUpdate(String queryString) {
|
||||
Statement stmt;
|
||||
try {
|
||||
stmt = con.createStatement();
|
||||
@@ -204,7 +270,7 @@ public class TippligaSQLConnector {
|
||||
|
||||
public void updatePost(int postId, String postText) {
|
||||
String postChecksum = getChecksum(postText);
|
||||
final long postEditTime = Instant.now().getEpochSecond();;
|
||||
final long postEditTime = Instant.now().getEpochSecond();
|
||||
final String postEditReason = "Update by tool.";
|
||||
int postEditUser = 2;
|
||||
String query = getPostUpdateQuery(postId, postText, postChecksum, postEditTime, postEditReason, postEditUser);
|
||||
@@ -258,4 +324,156 @@ public class TippligaSQLConnector {
|
||||
post = post.replace("'", "'");
|
||||
return post;
|
||||
}
|
||||
|
||||
public String getNextMailReminder(int hours) {
|
||||
String query = """
|
||||
WITH next_delivery_date AS (
|
||||
SELECT
|
||||
m.season,
|
||||
m.league,
|
||||
l.league_name,
|
||||
l.bet_type,
|
||||
m.matchday,
|
||||
m.matchday_name,
|
||||
delivery_date,
|
||||
STR_TO_DATE(delivery_date, '%Y-%m-%d %H:%i:%s') as parsed_delivery_date
|
||||
FROM phpbb_footb_matchdays m
|
||||
LEFT JOIN phpbb_footb_leagues l ON (m.season = l.season AND m.league = l.league)
|
||||
HAVING parsed_delivery_date > NOW() AND parsed_delivery_date < NOW() + INTERVAL {{remainingHours}} HOUR
|
||||
)
|
||||
""".replace("{{remainingHours}}", "" + hours);
|
||||
ResultSet rset = executeQuery(query);
|
||||
String reminder = null;
|
||||
try {
|
||||
if (rset.next()) {
|
||||
reminder = "Reminder for user: " + rset.getString("username") + " for matchday: " + rset.getString("matchday");
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return reminder;
|
||||
}
|
||||
|
||||
public ArrayList<WhatsAppReminder> getNextWhatsAppReminders(int hours) {
|
||||
final String remindersToSendQuery = """
|
||||
WITH delivery_date_next_day AS (
|
||||
SELECT
|
||||
m.season,
|
||||
m.league,
|
||||
l.league_name,
|
||||
l.bet_type,
|
||||
m.matchday,
|
||||
m.matchday_name,
|
||||
delivery_date,
|
||||
STR_TO_DATE(delivery_date, '%Y-%m-%d %H:%i:%s') as parsed_delivery_date
|
||||
FROM phpbb_footb_matchdays m
|
||||
LEFT JOIN phpbb_footb_leagues l ON (m.season = l.season AND m.league = l.league)
|
||||
HAVING parsed_delivery_date > NOW() AND parsed_delivery_date < NOW() + INTERVAL {{remainingHours}} HOUR
|
||||
)
|
||||
SELECT
|
||||
d.season,
|
||||
d.league,
|
||||
d.league_name,
|
||||
d.matchday,
|
||||
IF(d.matchday_name = '', CONCAT(d.matchday, '. Spieltag'), d.matchday_name) AS matchday_name,
|
||||
d.delivery_date,
|
||||
CASE
|
||||
WHEN DATE (d.parsed_delivery_date) = CURDATE() THEN 'heute'
|
||||
WHEN DATE (d.parsed_delivery_date) = CURDATE() + INTERVAL 1 DAY THEN 'morgen'
|
||||
ELSE DATE (d.parsed_delivery_date)
|
||||
END AS today_or_tomorrow,
|
||||
TIME_FORMAT(TIME(d.parsed_delivery_date), '%H:%i') AS time,
|
||||
'{{remainingHours}}' AS remaining_hours,
|
||||
b.user_id,
|
||||
u.username,
|
||||
CASE
|
||||
WHEN SUBSTR(pf.pf_handynummer, 1, 2) = '00' THEN pf.pf_handynummer
|
||||
WHEN SUBSTR(pf.pf_handynummer, 1, 1) = '+' THEN CONCAT('00', SUBSTR(pf.pf_handynummer, 2))
|
||||
WHEN SUBSTR(pf.pf_handynummer, 1, 2) = '01' THEN CONCAT('0049', SUBSTR(pf.pf_handynummer, 2))
|
||||
ELSE ''
|
||||
END AS pf_handynummer,
|
||||
count(*) AS missing_bets
|
||||
FROM delivery_date_next_day d
|
||||
LEFT JOIN phpbb_footb_matches m
|
||||
ON (d.season = m.season
|
||||
AND d.league = m.league
|
||||
AND d.matchday = m.matchday)
|
||||
LEFT JOIN phpbb_footb_bets b
|
||||
ON (m.season = b.season
|
||||
AND m.league = b.league
|
||||
AND m.match_no = b.match_no)
|
||||
LEFT JOIN phpbb_footb_matches mb
|
||||
ON (d.season = mb.season
|
||||
AND d.league = mb.league - 50
|
||||
AND d.matchday = mb.matchday
|
||||
AND (b.user_id + 2000 = mb.team_id_home OR b.user_id + 2000 = mb.team_id_guest))
|
||||
LEFT JOIN phpbb_footb_whatsapp_reminders r
|
||||
ON (m.season = r.season
|
||||
AND m.league = r.league
|
||||
AND m.matchday = r.matchday
|
||||
AND r.delivery_date = d.delivery_date
|
||||
AND b.user_id = r.user_id
|
||||
AND r.remaining_hours = {{remainingHours}})
|
||||
LEFT JOIN phpbb_users u
|
||||
ON (b.user_id = u.user_id)
|
||||
LEFT JOIN phpbb_footb_whatsapp_reminder_users wu
|
||||
ON (u.username = wu.username)
|
||||
LEFT JOIN phpbb_profile_fields_data pf
|
||||
ON (u.user_id = pf.user_id)
|
||||
WHERE ((d.bet_type = 0 AND mb.match_no IS NOT NULL) OR d.bet_type = 1)
|
||||
AND (b.goals_home = '' OR b.goals_guest = '')
|
||||
AND r.timestamp IS NULL
|
||||
AND m.status = 0
|
||||
AND wu.username IS NOT NULL
|
||||
AND pf.pf_handynummer != ''
|
||||
GROUP BY d.league_name, d.matchday, u.username, pf.pf_handynummer;
|
||||
""".replace("{{remainingHours}}", "" + hours);
|
||||
final int SEASON = 1;
|
||||
final int LEAGUE = 2;
|
||||
final int LEAGUE_NAME = 3;
|
||||
final int MATCHDAY = 4;
|
||||
final int MATCHDAY_NAME = 5;
|
||||
final int DELIVERY_DATE = 6;
|
||||
final int TODAY_OR_TOMORROW = 7;
|
||||
final int TIME = 8;
|
||||
final int HOURS = 9;
|
||||
final int USER_ID = 10;
|
||||
final int USERNAME = 11;
|
||||
final int PHONE_NUMBER = 12;
|
||||
final int MISSING_BETS = 13;
|
||||
try {
|
||||
ResultSet rset = executeQuery(remindersToSendQuery);
|
||||
ArrayList <WhatsAppReminder> reminders = new ArrayList<>();
|
||||
while (rset.next()) {
|
||||
reminders.add(
|
||||
new WhatsAppReminder(
|
||||
Integer.parseInt(rset.getString(SEASON)),
|
||||
Integer.parseInt(rset.getString(LEAGUE)),
|
||||
rset.getString(LEAGUE_NAME),
|
||||
Integer.parseInt(rset.getString(MATCHDAY)),
|
||||
rset.getString(MATCHDAY_NAME),
|
||||
rset.getString(DELIVERY_DATE),
|
||||
rset.getString(TODAY_OR_TOMORROW),
|
||||
rset.getString(TIME),
|
||||
Integer.parseInt(rset.getString(HOURS)),
|
||||
Integer.parseInt(rset.getString(USER_ID)),
|
||||
rset.getString(USERNAME),
|
||||
rset.getString(PHONE_NUMBER),
|
||||
Integer.parseInt(rset.getString(MISSING_BETS))
|
||||
)
|
||||
);
|
||||
}
|
||||
return reminders;
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
public void markWhatsAppReminderAsSent(WhatsAppReminder reminder) {
|
||||
String query = """
|
||||
INSERT INTO phpbb_footb_whatsapp_reminders
|
||||
(season, league, matchday, delivery_date, user_id, remaining_hours)
|
||||
VALUES
|
||||
(""" + reminder.season() + ", " + reminder.league() + ", " + reminder.matchday() + ", '" + reminder.deliveryDate() + "', " + reminder.userId() + ", " + reminder.remainingHours() + ");";
|
||||
executeUpdate(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package de.jeyp91.tippligaforum;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import de.jeyp91.tippliga.TLWMatch;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.*;
|
||||
@@ -22,11 +23,12 @@ public class TippligaWebsiteConnector {
|
||||
CookieManager cm = new CookieManager(null, CookiePolicy.ACCEPT_ALL);
|
||||
|
||||
CookieStore cookieStore = cm.getCookieStore();
|
||||
private static final Logger logger = LogManager.getLogger(TippligaWebsiteConnector.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(TippligaWebsiteConnector.class);
|
||||
private final HttpClient client;
|
||||
|
||||
private final String username = "Julian";
|
||||
private final String password = "original";
|
||||
private final String username = System.getenv("FORUM_USERNAME");
|
||||
private final String password = System.getenv("FORUM_PASSWORD");
|
||||
private String lastCreationTime = "";
|
||||
private String lastFormToken = "";
|
||||
|
||||
public TippligaWebsiteConnector() throws IOException {
|
||||
CookieHandler.setDefault(cm);
|
||||
@@ -37,7 +39,6 @@ public class TippligaWebsiteConnector {
|
||||
.build();
|
||||
login();
|
||||
adminLogin();
|
||||
updateResultsAdmin();
|
||||
}
|
||||
|
||||
private void login() throws IOException {
|
||||
@@ -57,8 +58,8 @@ public class TippligaWebsiteConnector {
|
||||
Matcher matcher = pattern.matcher(reqBody);
|
||||
matcher.find();
|
||||
|
||||
String creationTime = matcher.group(1);
|
||||
String formToken = matcher.group(2);
|
||||
this.lastCreationTime = matcher.group(1);
|
||||
this.lastFormToken = matcher.group(2);
|
||||
String sid = matcher.group(3);
|
||||
|
||||
Map<String, String> loginParameters = new HashMap<>();
|
||||
@@ -68,8 +69,8 @@ public class TippligaWebsiteConnector {
|
||||
loginParameters.put("viewonline", "on");
|
||||
loginParameters.put("username", username);
|
||||
loginParameters.put("password", password);
|
||||
loginParameters.put("creation_time", creationTime);
|
||||
loginParameters.put("form_token", formToken);
|
||||
loginParameters.put("creation_time", this.lastCreationTime);
|
||||
loginParameters.put("form_token", this.lastFormToken);
|
||||
loginParameters.put("sid", sid);
|
||||
|
||||
String loginForm = loginParameters.entrySet()
|
||||
@@ -113,8 +114,8 @@ public class TippligaWebsiteConnector {
|
||||
Matcher matcher = pattern.matcher(reqBody);
|
||||
matcher.find();
|
||||
|
||||
String creationTime = matcher.group(1);
|
||||
String formToken = matcher.group(2);
|
||||
this.lastCreationTime = matcher.group(1);
|
||||
this.lastFormToken = matcher.group(2);
|
||||
sid = matcher.group(3);
|
||||
String credential = matcher.group(4);
|
||||
|
||||
@@ -123,8 +124,8 @@ public class TippligaWebsiteConnector {
|
||||
loginParameters.put("redirect", "./../adm/index.php?sid=" + sid);
|
||||
loginParameters.put("username", username);
|
||||
loginParameters.put("password_" + credential, password);
|
||||
loginParameters.put("creation_time", creationTime);
|
||||
loginParameters.put("form_token", formToken);
|
||||
loginParameters.put("creation_time", this.lastCreationTime);
|
||||
loginParameters.put("form_token", this.lastFormToken);
|
||||
loginParameters.put("sid", sid);
|
||||
loginParameters.put("credential", credential);
|
||||
|
||||
@@ -150,7 +151,7 @@ public class TippligaWebsiteConnector {
|
||||
List<HttpCookie> loginReqCookieList = cookieStore.getCookies();
|
||||
}
|
||||
|
||||
private void updateResultsAdmin() {
|
||||
public void updateResultsAdmin(int season, int league, int matchday, List<TLWMatch> matches) {
|
||||
String sid = getSidFromCookie();
|
||||
String url = "https://tippliga-wuerzburg.de/adm/index.php?i=-football-football-acp-results_module&mode=manage&sid=" + sid;
|
||||
|
||||
@@ -170,26 +171,27 @@ public class TippligaWebsiteConnector {
|
||||
Matcher matcher = pattern.matcher(reqBody);
|
||||
matcher.find();
|
||||
|
||||
String creationTime = matcher.group(1);
|
||||
String formToken = matcher.group(2);
|
||||
return;
|
||||
}
|
||||
this.lastCreationTime = matcher.group(1);
|
||||
this.lastFormToken = matcher.group(2);
|
||||
|
||||
private void updateResults() {
|
||||
Map<String, String> resultParameters = new HashMap<>();
|
||||
|
||||
resultParameters.put("s", "2023");
|
||||
resultParameters.put("l", "2");
|
||||
resultParameters.put("m", "32");
|
||||
resultParameters.put("action", "result");
|
||||
resultParameters.put("goalsh384", "4");
|
||||
resultParameters.put("oldgoalsh384", "4");
|
||||
resultParameters.put("goalsg384", "3");
|
||||
resultParameters.put("oldgoalsg384", "4");
|
||||
resultParameters.put("goalsh380", "");
|
||||
resultParameters.put("oldgoalsh380", "");
|
||||
resultParameters.put("goalsg380", "");
|
||||
resultParameters.put("oldgoalsg380", "");
|
||||
resultParameters.put("s", String.valueOf(season));
|
||||
resultParameters.put("l", String.valueOf(league));
|
||||
resultParameters.put("m", String.valueOf(matchday));
|
||||
resultParameters.put("edit", "Speichern");
|
||||
resultParameters.put("creation_time", this.lastCreationTime);
|
||||
resultParameters.put("form_token", this.lastFormToken);
|
||||
matches.forEach(tlwMatch -> {
|
||||
String matchNo = String.valueOf(tlwMatch.getMatchNo());
|
||||
resultParameters.put("select_" + matchNo, "on");
|
||||
resultParameters.put("goals_home_" + matchNo, String.valueOf(tlwMatch.getGoalsHome()));
|
||||
resultParameters.put("goals_guest_" + matchNo, String.valueOf(tlwMatch.getGoalsGuest()));
|
||||
Integer goalsOverTimeHome = tlwMatch.getGoalsOvertimeHome();
|
||||
Integer goalsOvertimeGuest = tlwMatch.getGoalsOvertimeGuest();
|
||||
resultParameters.put("overtime_home_" + matchNo, goalsOverTimeHome == null ? "" : String.valueOf(goalsOverTimeHome));
|
||||
resultParameters.put("overtime_guest_" + matchNo, goalsOvertimeGuest == null ? "" : String.valueOf(goalsOvertimeGuest));
|
||||
});
|
||||
|
||||
String resultForm = resultParameters.entrySet()
|
||||
.stream()
|
||||
@@ -197,7 +199,7 @@ public class TippligaWebsiteConnector {
|
||||
.collect(Collectors.joining("&"));
|
||||
|
||||
HttpRequest resultReq = HttpRequest.newBuilder()
|
||||
.uri(URI.create("https://tippliga-wuerzburg.de/app.php/football/results?s=2023&l=2&m=32&action=result"))
|
||||
.uri(URI.create("https://tippliga-wuerzburg.de/adm/index.php?i=-football-football-acp-results_module&mode=manage&sid=" + sid))
|
||||
.headers("Content-Type", "application/x-www-form-urlencoded")
|
||||
.POST(HttpRequest.BodyPublishers.ofString(resultForm))
|
||||
.build();
|
||||
@@ -209,8 +211,11 @@ public class TippligaWebsiteConnector {
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
matcher = pattern.matcher(resultReqBody);
|
||||
matcher.find();
|
||||
|
||||
logger.info(resultReqBody);
|
||||
this.lastCreationTime = matcher.group(1);
|
||||
this.lastFormToken = matcher.group(2);
|
||||
}
|
||||
|
||||
private String getSidFromCookie() {
|
||||
|
||||
81
src/main/java/de/jeyp91/whatsapp/OpenAIConnector.java
Normal file
81
src/main/java/de/jeyp91/whatsapp/OpenAIConnector.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package de.jeyp91.whatsapp;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.HashMap;
|
||||
|
||||
import static de.jeyp91.apifootball.APIFootballConnector.stringToJSONObject;
|
||||
|
||||
public class OpenAIConnector {
|
||||
private final HttpClient client;
|
||||
private final String OPENAI_TOKEN = System.getenv("OPENAI_TOKEN");
|
||||
private final String OPENAPI_URL = "https://api.openai.com/v1/chat/completions";
|
||||
private final String OPENAPI_MODEL = "gpt-3.5-turbo-0125";
|
||||
private final HashMap<String, String> generatedMessages = new HashMap<>();
|
||||
|
||||
public OpenAIConnector() {
|
||||
client = HttpClient.newBuilder().build();
|
||||
}
|
||||
|
||||
public String getReminderMessage(WhatsAppReminder reminder) {
|
||||
String key = reminder.leagueName() + reminder.matchdayName() + reminder.todayTomorrow() + reminder.time();
|
||||
String message;
|
||||
if (generatedMessages.containsKey(key)) {
|
||||
message = generatedMessages.get(key);
|
||||
} else {
|
||||
message = executeReminderPrompt(reminder.leagueName(), reminder.matchdayName(), reminder.todayTomorrow(), reminder.time(), reminder.remainingHours());
|
||||
generatedMessages.put(key, message);
|
||||
}
|
||||
message = message.replace("Hey", "Hey " + reminder.username());
|
||||
String end = "\nDu kannst deine Tipps wie immer unter https://tippliga-wuerzburg.de/app.php/football/bet abgeben.\nViele Grüße\nDie Tippliga Admins";
|
||||
message += end;
|
||||
return message;
|
||||
}
|
||||
|
||||
private String executeReminderPrompt(String leagueName, String matchdayName, String deliveryDay, String time, int remainingHours) {
|
||||
String systemPrompt = "Generiere eine Nachricht, die dem Zweck dient, jemanden daran zu erinnern, seine noch fehlenden Tipps für den kommenden Spieltag abzuschicken. Die Nachricht muss so klingen, als ob ein Freund sie in natürlicher Sprache abschickt. Sie muss auf Deutsch sein. Die Nachricht muss den richtigen Singular und Plural für die Anzahl der fehlenden Wetten verwenden. Halte dich genau an die Vorlage und ersetze die Teile gekennzeichnet durch \"{}\" durch passende Passagen. Die Antwort auf diesen Prompt soll ausschließlich die Nachricht sein.\n\n "
|
||||
+"Dies ist die Vorlage:\n"
|
||||
+"Hey,\n"
|
||||
+ (remainingHours == 24 ? "{ein netter einleitender Satz der \"league_name\", \"matchday_name\" enthält}.\n" : "{ein einleitender Satz der \"league_name\", \"matchday_name\" enthält und klar macht, dass die Zeit abläuft und nur noch weniger als zwei Stunden Zeit für die Abgabe der Tipps bleibt}.\n")
|
||||
+"Bitte gib die fehlenden Tipps bis {delivery_day} um {time} ab.";
|
||||
JSONObject userInput = new JSONObject();
|
||||
userInput.put("league_name", leagueName);
|
||||
userInput.put("matchday_name", matchdayName);
|
||||
userInput.put("delivery_day", deliveryDay);
|
||||
userInput.put("time", time);
|
||||
String user = userInput.toJSONString();
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
jsonBody.put("model", OPENAPI_MODEL);
|
||||
JSONArray messages = new JSONArray();
|
||||
JSONObject system = new JSONObject();
|
||||
system.put("role", "system");
|
||||
system.put("content", systemPrompt);
|
||||
messages.add(system);
|
||||
JSONObject userMessage = new JSONObject();
|
||||
userMessage.put("role", "user");
|
||||
userMessage.put("content", user);
|
||||
messages.add(userMessage);
|
||||
jsonBody.put("messages", messages);
|
||||
HttpRequest openAIRequest = HttpRequest.newBuilder()
|
||||
.uri(URI.create(OPENAPI_URL))
|
||||
.headers("Content-Type", "application/json")
|
||||
.headers("Authorization", "Bearer " + OPENAI_TOKEN)
|
||||
.POST(HttpRequest.BodyPublishers.ofString(jsonBody.toJSONString()))
|
||||
.build();
|
||||
JSONObject response = new JSONObject();
|
||||
try {
|
||||
response = stringToJSONObject(client.send(openAIRequest, HttpResponse.BodyHandlers.ofString()).body());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
JSONArray choices = (JSONArray) response.get("choices");
|
||||
JSONObject choice = (JSONObject) choices.get(0);
|
||||
JSONObject message = (JSONObject) choice.get("message");
|
||||
return message.get("content").toString();
|
||||
}
|
||||
}
|
||||
70
src/main/java/de/jeyp91/whatsapp/WhatsAppNotifier.java
Normal file
70
src/main/java/de/jeyp91/whatsapp/WhatsAppNotifier.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package de.jeyp91.whatsapp;
|
||||
|
||||
import de.jeyp91.tippligaforum.TippligaSQLConnector;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class WhatsAppNotifier {
|
||||
private final String host = System.getenv("TLW_WHATSAPP_HOST");
|
||||
private final String port = System.getenv("TLW_WHATSAPP_PORT");
|
||||
private final String apiKey = System.getenv("TLW_WHATSAPP_API_KEY");
|
||||
private static final Logger logger = LoggerFactory.getLogger(WhatsAppNotifier.class);
|
||||
private final HttpClient client;
|
||||
private final OpenAIConnector openAIConnector = new OpenAIConnector();
|
||||
|
||||
public WhatsAppNotifier() {
|
||||
client = HttpClient.newBuilder()
|
||||
.connectTimeout(Duration.ofSeconds(10))
|
||||
.build();
|
||||
}
|
||||
|
||||
public void sendNotifications() {
|
||||
ArrayList<WhatsAppReminder> reminders = TippligaSQLConnector.getInstance().getNextWhatsAppReminders(24);
|
||||
reminders.addAll(TippligaSQLConnector.getInstance().getNextWhatsAppReminders(2));
|
||||
reminders.forEach(reminder -> {
|
||||
boolean success = sendMessage(reminder);
|
||||
if (success) {
|
||||
markReminderAsSent(reminder);
|
||||
logger.info("WhatsApp Erinnerung an " + reminder.username() + " gesendet.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean sendMessage(WhatsAppReminder reminder) {
|
||||
String message = openAIConnector.getReminderMessage(reminder);
|
||||
JSONObject body = new JSONObject();
|
||||
body.put("number", reminder.phoneNumber().substring(2));
|
||||
body.put("message", message);
|
||||
HttpRequest req = HttpRequest.newBuilder()
|
||||
.uri(URI.create(this.host + (this.port != null ? ":" + this.port : "") + "/send"))
|
||||
.headers("Content-Type", "application/json")
|
||||
.headers("x-api-key", apiKey)
|
||||
.POST(HttpRequest.BodyPublishers.ofString(body.toJSONString()))
|
||||
.build();
|
||||
boolean success = false;
|
||||
try {
|
||||
int responseCode = client.send(req, HttpResponse.BodyHandlers.ofString()).statusCode();
|
||||
if (responseCode != 200) {
|
||||
logger.error("Failed to send WhatsApp message. Response code: " + responseCode);
|
||||
} else {
|
||||
success = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Failed to send WhatsApp message: " + e.getMessage());
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
public void markReminderAsSent(WhatsAppReminder reminder) {
|
||||
TippligaSQLConnector.getInstance().markWhatsAppReminderAsSent(reminder);
|
||||
}
|
||||
}
|
||||
|
||||
16
src/main/java/de/jeyp91/whatsapp/WhatsAppReminder.java
Normal file
16
src/main/java/de/jeyp91/whatsapp/WhatsAppReminder.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package de.jeyp91.whatsapp;
|
||||
|
||||
public record WhatsAppReminder(int season,
|
||||
int league,
|
||||
String leagueName,
|
||||
int matchday,
|
||||
String matchdayName,
|
||||
String deliveryDate,
|
||||
String todayTomorrow,
|
||||
String time,
|
||||
int remainingHours,
|
||||
int userId,
|
||||
String username,
|
||||
String phoneNumber,
|
||||
int missingBets) {
|
||||
}
|
||||
102
src/main/resources/Tippliga/2024_Ligen.json
Normal file
102
src/main/resources/Tippliga/2024_Ligen.json
Normal file
@@ -0,0 +1,102 @@
|
||||
[
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Bundesliga",
|
||||
"league_id": 5348
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "2. Bundesliga",
|
||||
"league_id": 5347
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "3. Liga",
|
||||
"league_id": 5399
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Regionalliga - Bayern",
|
||||
"league_id": 5518
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Regionalliga - SudWest",
|
||||
"league_id": 5519
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "U19 Bundesliga",
|
||||
"league_id": 5436
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Frauen Bundesliga",
|
||||
"league_id": 5464
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "DFB Pokal",
|
||||
"league_id": 5275
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Super Cup",
|
||||
"league_id": 5223
|
||||
},
|
||||
{
|
||||
"country": "England",
|
||||
"name": "Premier League",
|
||||
"league_id": 5267
|
||||
},
|
||||
{
|
||||
"country": "Spain",
|
||||
"name": "La Liga",
|
||||
"league_id": 5284
|
||||
},
|
||||
{
|
||||
"country": "Italy",
|
||||
"name": "Serie A",
|
||||
"league_id": 5367
|
||||
},
|
||||
{
|
||||
"country": "France",
|
||||
"name": "Ligue 1",
|
||||
"league_id": 5322
|
||||
},
|
||||
{
|
||||
"country": "Turkey",
|
||||
"name": "Süper Lig",
|
||||
"league_id": 5476
|
||||
},
|
||||
{
|
||||
"country": "Netherlands",
|
||||
"name": "Eredivisie",
|
||||
"league_id": 5389
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Champions League",
|
||||
"league_id": 5262
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Europa League",
|
||||
"league_id": 5607
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Europa Conference League",
|
||||
"league_id": 5277
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Super Cup",
|
||||
"league_id": 5235
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "Euro Championship",
|
||||
"league_id": 5858
|
||||
}
|
||||
]
|
||||
97
src/main/resources/Tippliga/2025_Ligen.json
Normal file
97
src/main/resources/Tippliga/2025_Ligen.json
Normal file
@@ -0,0 +1,97 @@
|
||||
[
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Bundesliga",
|
||||
"league_id": 6375
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "2. Bundesliga",
|
||||
"league_id": 6387
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "3. Liga",
|
||||
"league_id": 6443
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Regionalliga - Bayern",
|
||||
"league_id": 6472
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Regionalliga - SudWest",
|
||||
"league_id": 6471
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "U19 Bundesliga",
|
||||
"league_id": 6572
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Frauen Bundesliga",
|
||||
"league_id": 6510
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "DFB Pokal",
|
||||
"league_id": 6244
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Super Cup",
|
||||
"league_id": 6247
|
||||
},
|
||||
{
|
||||
"country": "England",
|
||||
"name": "Premier League",
|
||||
"league_id": 6280
|
||||
},
|
||||
{
|
||||
"country": "Spain",
|
||||
"name": "La Liga",
|
||||
"league_id": 6284
|
||||
},
|
||||
{
|
||||
"country": "Italy",
|
||||
"name": "Serie A",
|
||||
"league_id": 6374
|
||||
},
|
||||
{
|
||||
"country": "France",
|
||||
"name": "Ligue 1",
|
||||
"league_id": 6315
|
||||
},
|
||||
{
|
||||
"country": "Turkey",
|
||||
"name": "Süper Lig",
|
||||
"league_id": 6447
|
||||
},
|
||||
{
|
||||
"country": "Netherlands",
|
||||
"name": "Eredivisie",
|
||||
"league_id": 6314
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Champions League",
|
||||
"league_id": 6281
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Europa League",
|
||||
"league_id": 6283
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Europa Conference League",
|
||||
"league_id": 6282
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Super Cup",
|
||||
"league_id": 6241
|
||||
}
|
||||
]
|
||||
117
src/main/resources/Tippliga/Ligen_v3.json
Normal file
117
src/main/resources/Tippliga/Ligen_v3.json
Normal file
@@ -0,0 +1,117 @@
|
||||
[
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Bundesliga",
|
||||
"league_id": 78
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "2. Bundesliga",
|
||||
"league_id": 79
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "3. Liga",
|
||||
"league_id": 80
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Regionalliga - Bayern",
|
||||
"league_id": 83
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Regionalliga - SudWest",
|
||||
"league_id": 86
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "U19 Bundesliga",
|
||||
"league_id": 488
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Frauen Bundesliga",
|
||||
"league_id": 82
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "DFB Pokal",
|
||||
"league_id": 81
|
||||
},
|
||||
{
|
||||
"country": "Germany",
|
||||
"name": "Super Cup",
|
||||
"league_id": 529
|
||||
},
|
||||
{
|
||||
"country": "England",
|
||||
"name": "Premier League",
|
||||
"league_id": 39
|
||||
},
|
||||
{
|
||||
"country": "Spain",
|
||||
"name": "La Liga",
|
||||
"league_id": 140
|
||||
},
|
||||
{
|
||||
"country": "Italy",
|
||||
"name": "Serie A",
|
||||
"league_id": 135
|
||||
},
|
||||
{
|
||||
"country": "France",
|
||||
"name": "Ligue 1",
|
||||
"league_id": 61
|
||||
},
|
||||
{
|
||||
"country": "Turkey",
|
||||
"name": "Süper Lig",
|
||||
"league_id": 203
|
||||
},
|
||||
{
|
||||
"country": "Netherlands",
|
||||
"name": "Eredivisie",
|
||||
"league_id": 88
|
||||
},
|
||||
{
|
||||
"country": "Austria",
|
||||
"name": "Bundesliga",
|
||||
"league_id": 218
|
||||
},
|
||||
{
|
||||
"country": "Portugal",
|
||||
"name": "Primeira Liga",
|
||||
"league_id": 94
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Champions League",
|
||||
"league_id": 2
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Europa League",
|
||||
"league_id": 3
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Europa Conference League",
|
||||
"league_id": 848
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "UEFA Super Cup",
|
||||
"league_id": 531
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "World Cup",
|
||||
"league_id": 1
|
||||
},
|
||||
{
|
||||
"country": "World",
|
||||
"name": "Euro Championship",
|
||||
"league_id": 4
|
||||
}
|
||||
]
|
||||
@@ -511,7 +511,7 @@
|
||||
},
|
||||
{
|
||||
"teamname": "FC Fulham",
|
||||
"tippligaID": 5555,
|
||||
"tippligaID": 555,
|
||||
"apiFootballID": 36
|
||||
},
|
||||
{
|
||||
@@ -1073,5 +1073,265 @@
|
||||
"teamname": "VfB Oldenburg",
|
||||
"tippligaID": 112,
|
||||
"apiFootballID": 9347
|
||||
},
|
||||
{
|
||||
"teamname": "TuS Bersenbrück",
|
||||
"tippligaID": 188,
|
||||
"apiFootballID": 14635
|
||||
},
|
||||
{
|
||||
"teamname": "TSG Balingen",
|
||||
"tippligaID": 189,
|
||||
"apiFootballID": 9360
|
||||
},
|
||||
{
|
||||
"teamname": "Atlas Delmenhorst",
|
||||
"tippligaID": 171,
|
||||
"apiFootballID": 4260
|
||||
},
|
||||
{
|
||||
"teamname": "FC Gütersloh",
|
||||
"tippligaID": 190,
|
||||
"apiFootballID": 14485
|
||||
},
|
||||
{
|
||||
"teamname": "Rostocker FC",
|
||||
"tippligaID": 191,
|
||||
"apiFootballID": 14762
|
||||
},
|
||||
{
|
||||
"teamname": "TuS Makkabi Berlin",
|
||||
"tippligaID": 192,
|
||||
"apiFootballID": 14722
|
||||
},
|
||||
{
|
||||
"teamname": "Freiburg II",
|
||||
"tippligaID": 193,
|
||||
"apiFootballID": 9363
|
||||
},
|
||||
{
|
||||
"teamname": "Bournemouth",
|
||||
"tippligaID": 624,
|
||||
"apiFootballID": 35
|
||||
},
|
||||
{
|
||||
"teamname": "Burnley",
|
||||
"tippligaID": 194,
|
||||
"apiFootballID": 44
|
||||
},
|
||||
{
|
||||
"teamname": "Crystal Palace",
|
||||
"tippligaID": 195,
|
||||
"apiFootballID": 52
|
||||
},
|
||||
{
|
||||
"teamname": "Sheffield Utd",
|
||||
"tippligaID": 196,
|
||||
"apiFootballID": 62
|
||||
},
|
||||
{
|
||||
"teamname": "Luton",
|
||||
"tippligaID": 197,
|
||||
"apiFootballID": 1359
|
||||
},
|
||||
{
|
||||
"teamname": "Genoa",
|
||||
"tippligaID": 560,
|
||||
"apiFootballID": 495
|
||||
},
|
||||
{
|
||||
"teamname": "Frosinone",
|
||||
"tippligaID": 198,
|
||||
"apiFootballID": 512
|
||||
},
|
||||
{
|
||||
"teamname": "Lecce",
|
||||
"tippligaID": 199,
|
||||
"apiFootballID": 867
|
||||
},
|
||||
{
|
||||
"teamname": "Cagliari",
|
||||
"tippligaID": 200,
|
||||
"apiFootballID": 490
|
||||
},
|
||||
{
|
||||
"teamname": "Salernitana",
|
||||
"tippligaID": 201,
|
||||
"apiFootballID": 514
|
||||
},
|
||||
{
|
||||
"teamname": "Sassuolo",
|
||||
"tippligaID": 202,
|
||||
"apiFootballID": 488
|
||||
},
|
||||
{
|
||||
"teamname": "Fiorentina",
|
||||
"tippligaID": 438,
|
||||
"apiFootballID": 502
|
||||
},
|
||||
{
|
||||
"teamname": "Torino",
|
||||
"tippligaID": 627,
|
||||
"apiFootballID": 503
|
||||
},
|
||||
{
|
||||
"teamname": "FC Copenhagen",
|
||||
"tippligaID": 473,
|
||||
"apiFootballID": 400
|
||||
},
|
||||
{
|
||||
"teamname": "Sporting Braga",
|
||||
"tippligaID": 457,
|
||||
"apiFootballID": 217
|
||||
},
|
||||
{
|
||||
"teamname": "Girona",
|
||||
"tippligaID": 648,
|
||||
"apiFootballID": 547
|
||||
},
|
||||
{
|
||||
"teamname": "PSV Eindhoven",
|
||||
"tippligaID": 510,
|
||||
"apiFootballID": 197
|
||||
},
|
||||
{
|
||||
"teamname": "Viktoria Plzen",
|
||||
"tippligaID": 598,
|
||||
"apiFootballID": 567
|
||||
},
|
||||
{
|
||||
"teamname": "PAOK Saloniki",
|
||||
"tippligaID": 579,
|
||||
"apiFootballID": 619
|
||||
},
|
||||
{
|
||||
"teamname": "Club Brugge KV",
|
||||
"tippligaID": 462,
|
||||
"apiFootballID": 569
|
||||
},
|
||||
{
|
||||
"teamname": "FC Toulouse",
|
||||
"tippligaID": 427,
|
||||
"apiFootballID": 96
|
||||
},
|
||||
{
|
||||
"teamname": "Stade Brestois 29",
|
||||
"tippligaID": 649,
|
||||
"apiFootballID": 106
|
||||
},
|
||||
{
|
||||
"teamname": "Albania",
|
||||
"tippligaID": 702,
|
||||
"apiFootballID": 778
|
||||
},
|
||||
{
|
||||
"teamname": "Slovenia",
|
||||
"tippligaID": 926,
|
||||
"apiFootballID": 1091
|
||||
},
|
||||
{
|
||||
"teamname": "Serbia",
|
||||
"tippligaID": 924,
|
||||
"apiFootballID": 14
|
||||
},
|
||||
{
|
||||
"teamname": "Romania",
|
||||
"tippligaID": 836,
|
||||
"apiFootballID": 774
|
||||
},
|
||||
{
|
||||
"teamname": "Georgia",
|
||||
"tippligaID": 751,
|
||||
"apiFootballID": 1104
|
||||
},
|
||||
{
|
||||
"teamname": "TuS Koblenz",
|
||||
"tippligaID": 32,
|
||||
"apiFootballID": 1648
|
||||
},
|
||||
{
|
||||
"teamname": "Phönix Lübeck",
|
||||
"tippligaID": 650,
|
||||
"apiFootballID": 12831
|
||||
},
|
||||
{
|
||||
"teamname": "Alemannia Aachen",
|
||||
"tippligaID": 7,
|
||||
"apiFootballID": 4259
|
||||
},
|
||||
{
|
||||
"teamname": "Borussia Hildesheim",
|
||||
"tippligaID": 651,
|
||||
"apiFootballID": 12742
|
||||
},
|
||||
{
|
||||
"teamname": "AJ Auxerre",
|
||||
"tippligaID": 652,
|
||||
"apiFootballID": 108
|
||||
},
|
||||
{
|
||||
"teamname": "FK Bodø/Glimt",
|
||||
"tippligaID": 653,
|
||||
"apiFootballID": 327
|
||||
},
|
||||
{
|
||||
"teamname": "Jagiellonia",
|
||||
"tippligaID": 654,
|
||||
"apiFootballID": 336
|
||||
},
|
||||
{
|
||||
"teamname": "Celje",
|
||||
"tippligaID": 655,
|
||||
"apiFootballID": 4360
|
||||
},
|
||||
{
|
||||
"teamname": "Legia Warszawa",
|
||||
"tippligaID": 656,
|
||||
"apiFootballID": 339
|
||||
},
|
||||
{
|
||||
"teamname": "Djurgardens IF",
|
||||
"tippligaID": 657,
|
||||
"apiFootballID": 364
|
||||
},
|
||||
{
|
||||
"teamname": "Rapid Wien",
|
||||
"tippligaID": 415,
|
||||
"apiFootballID": 781
|
||||
},
|
||||
{
|
||||
"teamname": "ZFC Meuselwitz",
|
||||
"tippligaID": 102,
|
||||
"apiFootballID": 9358
|
||||
},
|
||||
{
|
||||
"teamname": "Bahlinger SC",
|
||||
"tippligaID": 585,
|
||||
"apiFootballID": 9359
|
||||
},
|
||||
{
|
||||
"teamname": "SV Hemelingen",
|
||||
"tippligaID": 658,
|
||||
"apiFootballID": 12783
|
||||
},
|
||||
{
|
||||
"teamname": "RSV Eintracht",
|
||||
"tippligaID": 659,
|
||||
"apiFootballID": 14754
|
||||
},
|
||||
{
|
||||
"teamname": "Sturm Graz",
|
||||
"tippligaID": 559,
|
||||
"apiFootballID": 637
|
||||
},
|
||||
{
|
||||
"teamname": "Go Ahead Eagles",
|
||||
"tippligaID": 660,
|
||||
"apiFootballID": 410
|
||||
},
|
||||
{
|
||||
"teamname": "Espanyol",
|
||||
"tippligaID": 572,
|
||||
"apiFootballID": 540
|
||||
}
|
||||
]
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
},
|
||||
{
|
||||
"team_id": 2058,
|
||||
"team_name": "Nicole (TG Rhön)",
|
||||
"team_name": "Nicole",
|
||||
"team_name_short": "Nicole"
|
||||
},
|
||||
{
|
||||
@@ -273,5 +273,20 @@
|
||||
"team_id": 2133,
|
||||
"team_name": "Barb",
|
||||
"team_name_short": "Barb"
|
||||
},
|
||||
{
|
||||
"team_id": 2137,
|
||||
"team_name": "Johannes",
|
||||
"team_name_short": "Johannes"
|
||||
},
|
||||
{
|
||||
"team_id": 2138,
|
||||
"team_name": "TG ChatGPT",
|
||||
"team_name_short": "ChatGPT"
|
||||
},
|
||||
{
|
||||
"team_id": 2139,
|
||||
"team_name": "Dustin",
|
||||
"team_name_short": "Dustin"
|
||||
}
|
||||
]
|
||||
|
||||
297
src/main/resources/Tippliga_Configs/lc_2026.json
Normal file
297
src/main/resources/Tippliga_Configs/lc_2026.json
Normal file
@@ -0,0 +1,297 @@
|
||||
{
|
||||
"numberOfMatchdays": 7,
|
||||
"matchesPerMatchday": 0,
|
||||
"pointMode": 4,
|
||||
"pointsTendency": 1,
|
||||
"pointsDifference": 2,
|
||||
"pointsDirectHit": 3,
|
||||
"ko": 0,
|
||||
"matchdayConfig": [
|
||||
{
|
||||
"TLWMatchday": 1,
|
||||
"numberOfMatches": 12,
|
||||
"matchdayName": "1. Spieltag",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 3,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 4,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 2,
|
||||
"numberOfMatches": 12,
|
||||
"matchdayName": "2. Spieltag",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 7,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 8,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 9,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 10,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 11,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 12,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 3,
|
||||
"numberOfMatches": 12,
|
||||
"matchdayName": "3. Spieltag",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 13,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 14,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 15,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 16,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 17,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 18,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 4,
|
||||
"numberOfMatches": 8,
|
||||
"matchdayName": "Achtelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 19,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-06-29 18:00:00",
|
||||
"formulaHome": "G A2",
|
||||
"formulaGuest": "G B2"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-06-29 21:00:00",
|
||||
"formulaHome": "G A1",
|
||||
"formulaGuest": "G C2"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-06-30 18:00:00",
|
||||
"formulaHome": "G C1",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-06-30 21:00:00",
|
||||
"formulaHome": "G B1",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-01 18:00:00",
|
||||
"formulaHome": "G D2",
|
||||
"formulaGuest": "G E2"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-01 21:00:00",
|
||||
"formulaHome": "G F1",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-02 18:00:00",
|
||||
"formulaHome": "G E1",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-02 21:00:00",
|
||||
"formulaHome": "G D1",
|
||||
"formulaGuest": "G F2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 5,
|
||||
"numberOfMatches": 4,
|
||||
"matchdayName": "Viertelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 20,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-05 18:00:00",
|
||||
"formulaHome": "W 40",
|
||||
"formulaGuest": "W 38"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-05 21:00:00",
|
||||
"formulaHome": "W 42",
|
||||
"formulaGuest": "W 41"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-06 18:00:00",
|
||||
"formulaHome": "W 39",
|
||||
"formulaGuest": "W 37"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-06 21:00:00",
|
||||
"formulaHome": "W 43",
|
||||
"formulaGuest": "W 44"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 6,
|
||||
"numberOfMatches": 2,
|
||||
"matchdayName": "Halbfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 21,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-09 21:00:00",
|
||||
"formulaHome": "W 45",
|
||||
"formulaGuest": "W 46"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-10 21:00:00",
|
||||
"formulaHome": "W 48",
|
||||
"formulaGuest": "W 47"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 7,
|
||||
"numberOfMatches": 1,
|
||||
"matchdayName": "Finale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 22,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2024-07-14 21:00:00",
|
||||
"formulaHome": "W 49",
|
||||
"formulaGuest": "W 50"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
435
src/main/resources/Tippliga_Configs/tl_2025.json
Normal file
435
src/main/resources/Tippliga_Configs/tl_2025.json
Normal file
@@ -0,0 +1,435 @@
|
||||
{
|
||||
"numberOfMatchdays": 39,
|
||||
"matchesPerMatchday": 12,
|
||||
"pointMode": 4,
|
||||
"pointsTendency": 1,
|
||||
"pointsDifference": 2,
|
||||
"pointsDirectHit": 3,
|
||||
"ko": 0,
|
||||
"matchdayConfig": [
|
||||
{
|
||||
"TLWMatchday": 1,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6387,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 2,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6387,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 3,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 4,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 5,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 3,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 6,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 4,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 7,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 8,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 9,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 7,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 10,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 8,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 11,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 9,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 12,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 10,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 13,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 11,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 14,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 12,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 15,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 13,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 16,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 14,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 17,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 15,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 18,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-12-26 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 19,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 16,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 20,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 17,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 21,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 18,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 22,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 19,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 23,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 20,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 24,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 21,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 25,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 22,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 26,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 23,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 27,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 24,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 28,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 25,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 29,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 26,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 30,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2025-03-18 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 31,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 27,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 32,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 28,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 33,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 29,
|
||||
"showTable": true
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 34,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2025-04-15 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 35,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 30,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 36,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 31,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 37,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 32,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 38,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 33,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 39,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6375,
|
||||
"leagueMatchday": 34,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
1231
src/main/resources/Tippliga_Configs/tl_2025_v3.json
Normal file
1231
src/main/resources/Tippliga_Configs/tl_2025_v3.json
Normal file
File diff suppressed because it is too large
Load Diff
11
src/main/resources/Tippliga_Configs/tl_2026_ligen.sql
Normal file
11
src/main/resources/Tippliga_Configs/tl_2026_ligen.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 1, '1. Tippliga Würzburg', '1TL', 1, 39, 12, '0', '0', '0', '0', 4, 3, 1, 2, 0, 0, 0, 0, 561, 0, 1, 0.00, 0);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 2, '2. Tippliga Würzburg', '2TL', 1, 39, 12, '0', '0', '0', '0', 4, 3, 1, 2, 0, 0, 0, 0, 561, 0, 1, 0.00, 0);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 45, 'Supercup', 'SC', 2, 1, 0, '0', '0', '0', '0', 4, 3, 1, 2, 0, 0, 0, 1, 561, 0, 1, 0.00, 0);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 47, 'Relegation', 'REL', 2, 1, 0, '0', '0', '0', '0', 4, 3, 1, 2, 0, 0, 0, 1, 561, 0, 1, 0.00, 1);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 48, 'WTL-Pokal', 'WTL', 2, 5, 0, '0', '0', '0', '0', 4, 3, 1, 2, 0, 0, 0, 0, 561, 0, 1, 0.00, 0);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 49, 'WM-Tippspiel', 'EM', 2, 7, 0, '0', '0', '0', '0', 4, 3, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0.00, 1);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 51, '1. Tippliga Würzburg', '1TL', 1, 39, 7, '0', '0', '0', '0', 1, 0, 0, 0, 1, 0, 0, 0, 561, 0, 1, 0.00, 0);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 52, '2. Tippliga Würzburg', '2TL', 1, 39, 7, '0', '0', '0', '0', 1, 0, 0, 0, 1, 0, 0, 0, 561, 0, 1, 0.00, 0);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 95, 'Supercup', 'SC', 2, 2, 0, '0', '0', '0', '0', 1, 0, 0, 0, 1, 0, 0, 0, 561, 0, 1, 0.00, 0);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 97, 'Relegation', 'REL', 2, 1, 0, '0', '0', '0', '0', 1, 0, 0, 0, 1, 0, 0, 0, 561, 0, 1, 0.00, 0);
|
||||
INSERT INTO `phpbb_footb_leagues` (`season`, `league`, `league_name`, `league_name_short`, `league_type`, `matchdays`, `matches_on_matchday`, `win_result`, `win_result_02`, `win_matchday`, `win_season`, `points_mode`, `points_result`, `points_tendency`, `points_diff`, `points_last`, `join_by_user`, `join_in_season`, `bet_in_time`, `rules_post_id`, `sort`, `bet_ko_type`, `bet_points`, `bet_type`) VALUES (2026, 98, 'WTL-Pokal', 'WTL', 2, 6, 0, '0', '0', '0', '0', 1, 0, 0, 0, 1, 0, 0, 0, 561, 0, 1, 0.00, 0);
|
||||
434
src/main/resources/Tippliga_Configs/tl_2026_v3.json
Normal file
434
src/main/resources/Tippliga_Configs/tl_2026_v3.json
Normal file
@@ -0,0 +1,434 @@
|
||||
{
|
||||
"numberOfMatchdays": 39,
|
||||
"matchesPerMatchday": 12,
|
||||
"pointMode": 4,
|
||||
"pointsTendency": 1,
|
||||
"pointsDifference": 2,
|
||||
"pointsDirectHit": 3,
|
||||
"ko": 0,
|
||||
"matchdayConfig": [
|
||||
{
|
||||
"TLWMatchday": 1,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 79,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 2,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 79,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 3,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 4,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 5,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 3,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 6,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 4,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 7,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 8,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 9,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 7,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 10,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 8,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 11,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 9,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 12,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 10,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 13,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 11,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 14,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 12,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 15,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 13,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 16,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 14,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 17,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 15,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 18,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2025-12-26 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 19,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 16,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 20,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 17,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 21,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 18,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 22,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 19,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 23,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 20,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 24,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 21,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 25,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 22,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 26,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 23,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 27,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 24,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 28,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 25,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 29,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 26,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 30,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2026-03-17 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 31,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 27,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 32,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 28,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 33,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 29,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 34,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2026-04-14 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 35,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 30,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 36,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 31,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 37,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 32,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 38,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 33,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 39,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 78,
|
||||
"leagueMatchday": 34,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
114
src/main/resources/Tippliga_Configs/wtl_2023.json
Normal file
114
src/main/resources/Tippliga_Configs/wtl_2023.json
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
"numberOfMatchdays": 5,
|
||||
"matchesPerMatchday": 0,
|
||||
"pointMode": 4,
|
||||
"pointsTendency": 1,
|
||||
"pointsDifference": 2,
|
||||
"pointsDirectHit": 3,
|
||||
"ko": 1,
|
||||
"matchdayConfig": [
|
||||
{
|
||||
"TLWMatchday": 1,
|
||||
"matchdayName": "1. Runde",
|
||||
"numberOfMatches": 32,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5275,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2022-07-29 20:45:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 2,
|
||||
"numberOfMatches": 12,
|
||||
"matchdayName": "2. Spieltag",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5275,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2022-10-18 18:30:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 3,
|
||||
"numberOfMatches": 12,
|
||||
"matchdayName": "3. Spieltag",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5275,
|
||||
"leagueMatchday": 3,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2023-01-31 18:30:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 4,
|
||||
"numberOfMatches": 8,
|
||||
"matchdayName": "Achtelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5275,
|
||||
"leagueMatchday": 4,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2023-04-04 18:30:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 5,
|
||||
"numberOfMatches": 4,
|
||||
"matchdayName": "Viertelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5275,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5275,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5275,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5275,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2023-05-02 20:45:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
118
src/main/resources/Tippliga_Configs/wtl_2024.json
Normal file
118
src/main/resources/Tippliga_Configs/wtl_2024.json
Normal file
@@ -0,0 +1,118 @@
|
||||
{
|
||||
"numberOfMatchdays": 5,
|
||||
"matchesPerMatchday": 0,
|
||||
"pointMode": 4,
|
||||
"pointsTendency": 1,
|
||||
"pointsDifference": 2,
|
||||
"pointsDirectHit": 3,
|
||||
"ko": 1,
|
||||
"matchdayConfig": [
|
||||
{
|
||||
"TLWMatchday": 1,
|
||||
"matchdayName": "1. Runde",
|
||||
"numberOfMatches": 32,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 2,
|
||||
"numberOfMatches": 12,
|
||||
"matchdayName": "2. Spieltag",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 3,
|
||||
"numberOfMatches": 12,
|
||||
"matchdayName": "3. Spieltag",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 3,
|
||||
"showTable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 4,
|
||||
"numberOfMatches": 8,
|
||||
"matchdayName": "Achtelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 4,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-06-29 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 5,
|
||||
"numberOfMatches": 4,
|
||||
"matchdayName": "Viertelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-07-05 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 6,
|
||||
"numberOfMatches": 2,
|
||||
"matchdayName": "Halbfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-07-09 21:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 7,
|
||||
"numberOfMatches": 1,
|
||||
"matchdayName": "Finale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 5858,
|
||||
"leagueMatchday": 7,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-07-14 21:00:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
152
src/main/resources/Tippliga_Configs/wtl_2025.json
Normal file
152
src/main/resources/Tippliga_Configs/wtl_2025.json
Normal file
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"numberOfMatchdays": 5,
|
||||
"matchesPerMatchday": 0,
|
||||
"pointMode": 4,
|
||||
"pointsTendency": 1,
|
||||
"pointsDifference": 2,
|
||||
"pointsDirectHit": 3,
|
||||
"ko": 1,
|
||||
"matchdayConfig": [
|
||||
{
|
||||
"TLWMatchday": 1,
|
||||
"matchdayName": "1. Runde",
|
||||
"numberOfMatches": 32,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6244,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-08-16 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 2,
|
||||
"numberOfMatches": 16,
|
||||
"matchdayName": "Achtelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6244,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-10-29 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 3,
|
||||
"numberOfMatches": 8,
|
||||
"matchdayName": "Viertelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6244,
|
||||
"leagueMatchday": 3,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-12-03 18:30:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 4,
|
||||
"numberOfMatches": 4,
|
||||
"matchdayName": "Halbfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6244,
|
||||
"leagueMatchday": 4,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2025-02-04 18:30:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 5,
|
||||
"numberOfMatches": 6,
|
||||
"matchdayName": "Finale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6244,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6244,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6244,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 6244,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-04-01 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-04-02 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-04-01 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-04-02 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-05-24 20:00:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-05-24 20:00:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
152
src/main/resources/Tippliga_Configs/wtl_2025_v3.json
Normal file
152
src/main/resources/Tippliga_Configs/wtl_2025_v3.json
Normal file
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"numberOfMatchdays": 5,
|
||||
"matchesPerMatchday": 0,
|
||||
"pointMode": 4,
|
||||
"pointsTendency": 1,
|
||||
"pointsDifference": 2,
|
||||
"pointsDirectHit": 3,
|
||||
"ko": 1,
|
||||
"matchdayConfig": [
|
||||
{
|
||||
"TLWMatchday": 1,
|
||||
"matchdayName": "1. Runde",
|
||||
"numberOfMatches": 32,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-08-16 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 2,
|
||||
"numberOfMatches": 16,
|
||||
"matchdayName": "Achtelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-10-29 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 3,
|
||||
"numberOfMatches": 8,
|
||||
"matchdayName": "Viertelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 3,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2024-12-03 18:30:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 4,
|
||||
"numberOfMatches": 4,
|
||||
"matchdayName": "Halbfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 4,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2025-02-04 18:30:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 5,
|
||||
"numberOfMatches": 6,
|
||||
"matchdayName": "Finale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-04-01 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-04-02 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-04-01 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-04-02 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-05-24 20:00:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2025-05-24 20:00:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
152
src/main/resources/Tippliga_Configs/wtl_2026.json
Normal file
152
src/main/resources/Tippliga_Configs/wtl_2026.json
Normal file
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"numberOfMatchdays": 5,
|
||||
"matchesPerMatchday": 0,
|
||||
"pointMode": 4,
|
||||
"pointsTendency": 1,
|
||||
"pointsDifference": 2,
|
||||
"pointsDirectHit": 3,
|
||||
"ko": 1,
|
||||
"matchdayConfig": [
|
||||
{
|
||||
"TLWMatchday": 1,
|
||||
"matchdayName": "1. Runde",
|
||||
"numberOfMatches": 32,
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 1,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2025-08-15 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 2,
|
||||
"numberOfMatches": 16,
|
||||
"matchdayName": "Achtelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 2,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2025-10-28 18:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 3,
|
||||
"numberOfMatches": 8,
|
||||
"matchdayName": "Viertelfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 3,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2025-12-02 18:30:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 4,
|
||||
"numberOfMatches": 4,
|
||||
"matchdayName": "Halbfinale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 4,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "Placeholder",
|
||||
"placeholderDatetime": "2026-02-03 18:30:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 5,
|
||||
"numberOfMatches": 6,
|
||||
"matchdayName": "Finale",
|
||||
"matchesConfig": [
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 5,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "AllMatchesOfMatchday",
|
||||
"matchesLeague": 81,
|
||||
"leagueMatchday": 6,
|
||||
"showTable": true
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2026-04-21 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2026-04-21 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2026-04-22 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2026-04-22 20:45:00",
|
||||
"formulaHome": "D",
|
||||
"formulaGuest": "D"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2026-05-23 20:00:00",
|
||||
"formulaHome": "W 61",
|
||||
"formulaGuest": "W 63"
|
||||
},
|
||||
{
|
||||
"type": "PlaceholderSingleMatch",
|
||||
"koMatch": true,
|
||||
"placeholderDatetime": "2026-05-23 20:00:00",
|
||||
"formulaHome": "W 62",
|
||||
"formulaGuest": "W 64"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
167
src/main/resources/tippliga_config_template.json
Normal file
167
src/main/resources/tippliga_config_template.json
Normal file
@@ -0,0 +1,167 @@
|
||||
{
|
||||
"numberOfMatchdays": 39,
|
||||
"matchesPerMatchday": 12,
|
||||
"pointMode": 4,
|
||||
"pointsTendency": 1,
|
||||
"pointsDifference": 2,
|
||||
"pointsDirectHit": 3,
|
||||
"ko": 0,
|
||||
"matchdayConfig": [
|
||||
{
|
||||
"TLWMatchday": 1,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 2,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 3,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 4,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 5,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 6,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 7,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 8,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 9,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 10,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 11,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 12,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 13,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 14,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 15,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 16,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 17,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 18,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 19,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 20,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 21,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 22,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 23,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 24,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 25,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 26,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 27,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 28,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 29,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 30,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 31,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 32,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 33,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 34,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 35,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 36,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 37,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 38,
|
||||
"matchesConfig": []
|
||||
},
|
||||
{
|
||||
"TLWMatchday": 39,
|
||||
"matchesConfig": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package de.jeyp91;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.junit.Test;
|
||||
|
||||
public class S3ProviderTest {
|
||||
@@ -7,7 +8,7 @@ public class S3ProviderTest {
|
||||
@Test
|
||||
public void getFixturesFromS3Test() {
|
||||
S3Provider prov = new S3Provider();
|
||||
String rounds = prov.getFixturesStringFromS3(1240);
|
||||
System.out.println(rounds);
|
||||
JSONObject rounds = prov.getFixturesJSONFromS3(2026, 1240);
|
||||
System.out.println(rounds.toJSONString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,28 +4,30 @@ import org.junit.Test;
|
||||
|
||||
public class APIFootballUpdaterTest {
|
||||
|
||||
int season = 2026;
|
||||
|
||||
@Test
|
||||
public void checkErrorsTest() {
|
||||
String exceededLimitDayError = "{\"api\":{\"results\":0,\"error\":\"You have reached the request limit for the day\"}}";
|
||||
String rateLimitError = "{\"results\":0,\"errors\":{\"rateLimit\":\"Too many requests. Your rate limit is 10 requests per minute.\"}}";
|
||||
APIFootballUpdater updater = new APIFootballUpdater();
|
||||
try {
|
||||
updater.checkErrors("https://test.url/api", exceededLimitDayError);
|
||||
updater.checkErrors("https://test.url/api", rateLimitError);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
assert e.getMessage().equals("https://test.url/api returned error: 'You have reached the request limit for the day'");
|
||||
assert e.getMessage().equals("https://test.url/api returned error: '{\"rateLimit\":\"Too many requests. Your rate limit is 10 requests per minute.\"}'");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateFixturesTest() {
|
||||
APIFootballUpdater updater = new APIFootballUpdater();
|
||||
// updater.updateFixtures(1240);
|
||||
updater.updateFixtures(season, 218);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateAllFixturesTest() {
|
||||
APIFootballUpdater updater = new APIFootballUpdater();
|
||||
// updater.updateAllFixtures();
|
||||
updater.updateAllFixtures(season);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -37,6 +39,6 @@ public class APIFootballUpdaterTest {
|
||||
@Test
|
||||
public void updateAllRoundsTest() {
|
||||
APIFootballUpdater updater = new APIFootballUpdater();
|
||||
// updater.updateAllRounds();
|
||||
updater.updateAllRounds(season);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,15 @@ public class TippligaGoogleEventManagerTest {
|
||||
|
||||
@Test
|
||||
public void createOrUpdateEventsForMatchdayTippligaTest() {
|
||||
TLWMatchdaysCreator creator = new TLWMatchdaysCreator(2022, 1, "Tippliga");
|
||||
TLWMatchdaysCreator creator = new TLWMatchdaysCreator(2024, 1, "Tippliga");
|
||||
ArrayList<TLWMatchday> matchdays = creator.getMatchdays();
|
||||
|
||||
matchdays.forEach(TippligaGoogleEventManager::createOrUpdateEventsForMatchday);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createOrUpdateEventsForMatchdaySupercupTest() {
|
||||
TLWMatchdaysCreator creator = new TLWMatchdaysCreator(2024, 45, "Supercup");
|
||||
ArrayList<TLWMatchday> matchdays = creator.getMatchdays();
|
||||
|
||||
matchdays.forEach(TippligaGoogleEventManager::createOrUpdateEventsForMatchday);
|
||||
@@ -61,7 +69,7 @@ public class TippligaGoogleEventManagerTest {
|
||||
|
||||
@Test
|
||||
public void createOrUpdateEventsForMatchdayWTLPokalTest() {
|
||||
TLWMatchdaysCreator creator = new TLWMatchdaysCreator(2022, 48, "WTL-Pokal");
|
||||
TLWMatchdaysCreator creator = new TLWMatchdaysCreator(2024, 48, "WTL-Pokal");
|
||||
ArrayList<TLWMatchday> matchdays = creator.getMatchdays();
|
||||
// createOrUpdateEventsForMatchday(matchdays.get(4));
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
package de.jeyp91.tippliga;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import org.junit.Test;
|
||||
|
||||
public class TLWMatchdaysCreatorTest {
|
||||
|
||||
int season = 2023;
|
||||
int season = 2026;
|
||||
|
||||
@Test
|
||||
public void getMatchdaysTippligaTest() {
|
||||
|
||||
@@ -8,7 +8,7 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class TLWMatchesCreatorFootballTest {
|
||||
|
||||
int season = 2023;
|
||||
int season = 2026;
|
||||
|
||||
@Test
|
||||
public void getMatchesTest() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.junit.Test;
|
||||
|
||||
public class TLWMatchesCreatorTipperPokalTest {
|
||||
|
||||
int season = 2023;
|
||||
int season = 2026;
|
||||
|
||||
@Test
|
||||
public void getMatchesWTLPokalTest() {
|
||||
|
||||
@@ -2,13 +2,9 @@ package de.jeyp91.tippliga;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class TLWMatchesCreatorTipperTest {
|
||||
|
||||
int season = 2023;
|
||||
int season = 2026;
|
||||
|
||||
@Test
|
||||
public void getMatchesTippliga1Test() {
|
||||
|
||||
@@ -2,32 +2,12 @@ package de.jeyp91.tippliga;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class TLWMatchesUpdaterFootballTest {
|
||||
public class TLWMatchesResultsUpdaterTest {
|
||||
|
||||
@Test
|
||||
public void getUpdateSqlTest1() {
|
||||
TLWMatchesUpdaterFootball updater = new TLWMatchesUpdaterFootball(2022, 1, "Tippliga");
|
||||
String sql = updater.getUpdateSQL();
|
||||
|
||||
// System.out.println(sql);
|
||||
// System.out.println(updater.getBeautifulInfo());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUpdateSqlTest2() {
|
||||
TLWMatchesUpdaterFootball updater = new TLWMatchesUpdaterFootball(2021, 2, "Tippliga");
|
||||
String sql = updater.getUpdateSQL();
|
||||
|
||||
// System.out.println(sql);
|
||||
// System.out.println(updater.getBeautifulInfo());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUpdateSqlTest48() {
|
||||
TLWMatchesUpdaterFootball updater = new TLWMatchesUpdaterFootball(2021, 48, "WTL-Pokal");
|
||||
String sql = updater.getUpdateSQL();
|
||||
|
||||
// System.out.println(sql);
|
||||
// System.out.println(updater.getBeautifulInfo());
|
||||
public void updateResultsTest1() {
|
||||
TLWMatchesResultsUpdater updater = new TLWMatchesResultsUpdater(2024, 48, "WTL-Pokal");
|
||||
// updater.applyUpdates();
|
||||
System.out.println(updater.getBeautifulInfo());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,30 +4,32 @@ import org.junit.Test;
|
||||
|
||||
public class TLWMatchesUpdaterFootballTest {
|
||||
|
||||
int season = 2026;
|
||||
@Test
|
||||
public void getUpdateSqlTest1() {
|
||||
TLWMatchesUpdaterFootball updater = new TLWMatchesUpdaterFootball(2022, 1, "Tippliga");
|
||||
TLWMatchesUpdaterFootball updater = new TLWMatchesUpdaterFootball(season, 1, "Tippliga");
|
||||
String sql = updater.getUpdateSQL();
|
||||
String beatifulInfo = updater.getBeautifulInfo();
|
||||
|
||||
// System.out.println(sql);
|
||||
// System.out.println(updater.getBeautifulInfo());
|
||||
System.out.println(sql);
|
||||
// System.out.println(beatifulInfo);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUpdateSqlTest2() {
|
||||
TLWMatchesUpdaterFootball updater = new TLWMatchesUpdaterFootball(2021, 2, "Tippliga");
|
||||
TLWMatchesUpdaterFootball updater = new TLWMatchesUpdaterFootball(season, 2, "Tippliga");
|
||||
String sql = updater.getUpdateSQL();
|
||||
|
||||
// System.out.println(sql);
|
||||
System.out.println(sql);
|
||||
// System.out.println(updater.getBeautifulInfo());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUpdateSqlTest48() {
|
||||
TLWMatchesUpdaterFootball updater = new TLWMatchesUpdaterFootball(2021, 48, "WTL-Pokal");
|
||||
TLWMatchesUpdaterFootball updater = new TLWMatchesUpdaterFootball(season, 48, "WTL-Pokal");
|
||||
String sql = updater.getUpdateSQL();
|
||||
|
||||
// System.out.println(sql);
|
||||
System.out.println(sql);
|
||||
// System.out.println(updater.getBeautifulInfo());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package de.jeyp91.tippliga;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class TLWTeamsCreatorTest {
|
||||
|
||||
int season = 2023;
|
||||
int season = 2026;
|
||||
|
||||
@Test
|
||||
public void getTeamsTippligaFootball1Test() {
|
||||
@@ -56,13 +53,13 @@ public class TLWTeamsCreatorTest {
|
||||
TLWMatchesCreatorFootball matchesCreator = new TLWMatchesCreatorFootball(2021, 49, "EM-Tippspiel");
|
||||
ArrayList<TLWMatch> matches = matchesCreator.getMatches();
|
||||
|
||||
TLWTeamsCreator teamCreator = new TLWTeamsCreator(2021, 49, matches);
|
||||
TLWTeamsCreator teamCreator = new TLWTeamsCreator(season, 49, matches);
|
||||
String sql = teamCreator.getSql();
|
||||
System.out.println(sql);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTeamsTipper1TLTest() throws ParseException {
|
||||
public void getTeamsTipper1TLTest() {
|
||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 1, "Tippliga");
|
||||
|
||||
TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(season, 51, "1. Tippliga Tipper", matchdaysCreator.getMatchdays());
|
||||
@@ -75,7 +72,7 @@ public class TLWTeamsCreatorTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTeamsTipper2TLTest() throws ParseException {
|
||||
public void getTeamsTipper2TLTest() {
|
||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 2, "Tippliga");
|
||||
|
||||
TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(season, 52, "2. Tippliga Tipper", matchdaysCreator.getMatchdays());
|
||||
@@ -88,7 +85,7 @@ public class TLWTeamsCreatorTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTeamsTipperWTLTest() throws ParseException {
|
||||
public void getTeamsTipperWTLTest() {
|
||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 48, "WTL-Pokal");
|
||||
|
||||
TLWMatchesCreatorTipperPokal creator = new TLWMatchesCreatorTipperPokal(season, 98, "WTL-Pokal Tipper", matchdaysCreator.getMatchdays());
|
||||
|
||||
@@ -1,41 +1,40 @@
|
||||
package de.jeyp91.tippligaforum;
|
||||
|
||||
import de.jeyp91.tippligaforum.MatchesListCreator;
|
||||
import org.junit.Test;
|
||||
|
||||
public class MatchesListCreatorTest {
|
||||
|
||||
@Test
|
||||
public void getMatchesTest2664() {
|
||||
MatchesListCreator creator = new MatchesListCreator(2664);
|
||||
MatchesListCreator creator = new MatchesListCreator(2026, 2664);
|
||||
String matches = creator.getMatchesBeautiful();
|
||||
// System.out.println(matches);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMatchesTest2743() {
|
||||
MatchesListCreator creator = new MatchesListCreator(2743);
|
||||
MatchesListCreator creator = new MatchesListCreator(2026, 2743);
|
||||
String matches = creator.getMatchesBeautiful();
|
||||
System.out.println(matches);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMatchesTest2755() {
|
||||
MatchesListCreator creator = new MatchesListCreator(2755);
|
||||
MatchesListCreator creator = new MatchesListCreator(2026, 2755);
|
||||
String matches = creator.getMatchesBeautiful();
|
||||
// System.out.println(matches);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMatchesTest2790() {
|
||||
MatchesListCreator creator = new MatchesListCreator(2790);
|
||||
MatchesListCreator creator = new MatchesListCreator(2026, 2790);
|
||||
String matches = creator.getMatchesBeautiful();
|
||||
// System.out.println(matches);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMatchesTest2795() {
|
||||
MatchesListCreator creator = new MatchesListCreator(2795);
|
||||
MatchesListCreator creator = new MatchesListCreator(2026, 2795);
|
||||
String matches = creator.getMatchesBeautiful();
|
||||
// System.out.println(matches);
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ public class MatchesListForumUpdaterTest {
|
||||
|
||||
@Test
|
||||
public void updateAllLeaguesTest() {
|
||||
MatchesListForumUpdater updater = new MatchesListForumUpdater(2022);
|
||||
// updater.updateAllLeagues(2022);
|
||||
MatchesListForumUpdater updater = new MatchesListForumUpdater();
|
||||
updater.updateAllLeagues(2026);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateLeagueTest() {
|
||||
MatchesListForumUpdater updater = new MatchesListForumUpdater(2022);
|
||||
updater.updateLeague(2022, 3509);
|
||||
MatchesListForumUpdater updater = new MatchesListForumUpdater();
|
||||
updater.updateLeague(2026, 218);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
package de.jeyp91.tippligaforum;
|
||||
|
||||
import de.jeyp91.tippliga.TLWMatch;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TippligaWebsiteConnectorTest {
|
||||
@Test
|
||||
public void getChecksumOfPostTest() throws IOException {
|
||||
public void updateResultsAdminTest() throws IOException {
|
||||
TippligaWebsiteConnector con = new TippligaWebsiteConnector();
|
||||
List<TLWMatch> matches = new ArrayList<>();
|
||||
TLWMatch match = new TLWMatch(2023, 48, 5, 61, "0", 3, 0);
|
||||
match.setGoalsHome(1);
|
||||
match.setGoalsGuest(5);
|
||||
matches.add(match);
|
||||
con.updateResultsAdmin(2023, 48, 5, matches);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user