Fetch weather stations in cron from ftp server

This commit is contained in:
Guntis Smaukstelis
2025-10-29 23:38:30 +02:00
parent d621c2c89a
commit 56b85cbae2
3 changed files with 49 additions and 13 deletions
@@ -6,6 +6,7 @@ import org.typelevel.log4cats.Logger
import org.typelevel.log4cats.slf4j.Slf4jLogger
import java.io.ByteArrayOutputStream
import java.nio.charset.StandardCharsets
final case class LVGMCServerConfig(
username: String,
@@ -85,4 +86,8 @@ class FetchService(log: Logger[IO]) {
} yield content
}
}
def fetchWeatherStations(): IO[String] = {
fetchFile("Latvija_faktiskais_laiks.csv").map(result => new String(result, StandardCharsets.UTF_8))
}
}