Implement FZ download

This commit is contained in:
2025-07-28 20:59:38 +02:00
parent d6a9e7156f
commit c8372b1fa5
7 changed files with 191 additions and 49 deletions
+7 -16
View File
@@ -1,21 +1,12 @@
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Control.Exception (bracket)
import qualified Data.Text.IO as TextIO
import qualified Database.PostgreSQL.Opium as Opium
import qualified Yore.DB
import Yore.Repl (getToday)
main :: IO ()
main = bracket unsafeConnect Opium.close $ \conn -> do
result <- Yore.DB.getTables conn
case result of
Left e ->
putStrLn $ "Got error: " ++ show e
Right rows ->
mapM_ print rows
where
unsafeConnect = either (error . show) id <$> Opium.connect "host=localhost port=5432 user=yore-test dbname=yore-test"
main = do
putStrLn "* Getting URLs for today..."
urls <- getToday
putStrLn "* Done:"
mapM_ TextIO.putStrLn urls