add readme n shit
This commit is contained in:
parent
5e0e2288b9
commit
bfc595dc16
6 changed files with 51 additions and 13 deletions
|
|
@ -9,8 +9,16 @@ data class ReactableOffer(
|
|||
)
|
||||
|
||||
fun main() {
|
||||
val inputFile = File("rooms-scanned.txt")
|
||||
|
||||
val roomsFound = if (inputFile.exists()) inputFile.readLines() else listOf()
|
||||
|
||||
val rooms = getRooms().filter { room ->
|
||||
room.unitType == config.general.unitType
|
||||
room.unitType == config.general.unitType && room.wocasId !in roomsFound
|
||||
}
|
||||
if (rooms.isEmpty()) {
|
||||
println("No suitable offers were found, quitting.")
|
||||
return
|
||||
}
|
||||
val offers = getOffers(rooms.map { it.wocasId }).offers.filter { offer ->
|
||||
offer.adres[0].plaats !in listOf(
|
||||
|
|
@ -62,12 +70,14 @@ fun main() {
|
|||
|
||||
str.append("| Roken | ${if (it.floor.floorInfo.smokingAllowed) "✅ Mag" else "❌ Mag niet"} |\n")
|
||||
str.append("| Huisdieren | ${if (it.floor.floorInfo.petsAllowed) "✅ Mogen" else "❌ Mogen niet"} |\n")
|
||||
str.append("| Reacties | ${it.floor.applicantCount} al gereageerd.")
|
||||
|
||||
str.append("\n")
|
||||
str.append("### Message: \n\n${it.floor.floorInfo.description}\n")
|
||||
str.append("### Message: \n\n${it.floor.floorInfo.description ?: "Deze pannekoeken hebben geen bericht achtergelaten"}\n")
|
||||
|
||||
str.append("\n\n")
|
||||
}
|
||||
out.writeText(str.toString())
|
||||
inputFile.writeText(roomsFound.joinToString("\n") + rooms.joinToString("\n") { it.wocasId })
|
||||
println("${coupled.size} offers found, wrote to $fileName")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import kotlinx.serialization.json.Json
|
|||
@Serializable
|
||||
data class FloorInfo(
|
||||
@SerialName("WocasId") val wocasId: String,
|
||||
@SerialName("Description") val description: String,
|
||||
@SerialName("Description") val description: String?,
|
||||
@SerialName("HospiteerDate") val hospiteerDate: String?,
|
||||
@SerialName("PreferenceSmokingAllowed") val smokingAllowed: Boolean,
|
||||
@SerialName("PreferencePetsAllowed") val petsAllowed: Boolean,
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@ package me.koendev
|
|||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import me.koendev.utils.println
|
||||
import java.net.http.HttpClient
|
||||
import java.net.http.HttpResponse
|
||||
|
||||
@Serializable
|
||||
data class Offers(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue