This commit is contained in:
Norbert Litkowski 2021-04-07 13:38:47 +02:00
parent 5c7345957c
commit ea12e8ac21

View File

@ -12,8 +12,6 @@ import Data.List.Utils (replace)
import Text.Printf import Text.Printf
import Control.Lens.Regex.Text import Control.Lens.Regex.Text
import Control.Lens.Regex
import Control.Lens
getLinkAndText xpathCondition = proc doc -> do getLinkAndText xpathCondition = proc doc -> do
xpathTrees <- getXPathTrees xpathCondition -< doc xpathTrees <- getXPathTrees xpathCondition -< doc
@ -47,10 +45,11 @@ toShadowItem (((url, releaseTitle), collectionTitle), categoryTitle) =
finalUrl = url finalUrl = url
} }
where title = categoryTitle ++ (" " ++ collectionTitle) where title = categoryTitle ++ (" " ++ collectionTitle)
date = getDate $ releaseTitle date = releaseTitle
-- date = getDate $ releaseTitle
getDate txt = txt ^? [regex|19[0-9][0-9]|20[0-9][0-9]|] . match -- getDate txt = txt ^? [regex|19[0-9][0-9]|20[0-9][0-9]|] . match
main = do main = do
let start = "http://zborbielawa.pl/archiwum/" let start = "http://zborbielawa.pl/archiwum/"