diff --git a/app/czasopisma.hs b/app/czasopisma.hs index d8ba9d7..a663914 100644 --- a/app/czasopisma.hs +++ b/app/czasopisma.hs @@ -25,15 +25,23 @@ toShadowItem ((url, articleTitle), yearlyTitle) = format = Just "pdf", finalUrl = url } - where title = replace "\"" "'" (replace "\t\t\t\t\t" "" (replace "\n" "" yearlyTitle)) ++ "articleTitle: " ++ articleTitle + where homeTitle = getTitle url + title = replace "_" " " homeTitle ++ "ROK " ++ date ++ " " ++ articleTitle date = getDate url + getDate url = case url =~~ "_(19[0-9][0-9]|20[0-9][0-9])" :: Maybe [[String]] of Just [[_, year]] -> year otherwise -> error $ "unexpected url: " ++ url +getTitle url = + case url =~~ "/([A-Za-z]+_|[A-Za-z]+_[A-Za-z]+_|[A-Za-z]+_[A-Za-z]+_[A-Za-z]+_|[A-Za-z]+_[A-Za-z]+_[A-Za-z]+_[A-Za-z]+_|[A-Za-z]+_[A-Za-z]+_[A-Za-z]+_[A-Za-z]+_[A-Za-z]+_)" :: Maybe [[String]] of + Just [[_, title]] -> title + otherwise -> error $ "unexpected url2: " ++ url + + main = do let start = "https://www.czasopisma.centralnabibliotekapttk.pl" let shadowLibrary = ShadowLibrary {logoUrl=Nothing,