forked from filipg/twilight-library
fix for title
This commit is contained in:
parent
0a241f4892
commit
dc83563238
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user