changed print method for originalDate

This commit is contained in:
wiktor7245 2021-04-16 13:04:05 +02:00
parent 25556a322b
commit b7f0e2cf38

View File

@ -16,9 +16,9 @@ extractRecords = extractLinksWithText ("//a[contains(@href,'title='" ++ "\r[a-zA
>>> first (extractLinksWithText "//a[contains(@href,'.pdf')]")
>>> first (arr $ second (arr $ replace " " ""))
>>> first (arr $ second (arr $ replace "ń" "n"))
>>> first (arr $ second (arr $ replace "ś" "s"))
>>> first (arr $ second (arr $ replace "ź" "z"))
>>> first (arr $ second (arr $ replace "ł" "l"))
>>> first (arr $ second (arr $ replace "ś" "s"))
>>> first (arr $ second (arr $ replace "ź" "z"))
>>> first (arr $ second (arr $ replace "ł" "l"))
>>> first (arr $ second (arr $ replace "Styczen" "01"))
>>> first (arr $ second (arr $ replace "Luty" "02"))
>>> first (arr $ second (arr $ replace "Marzec" "03"))
@ -44,12 +44,8 @@ toShadowItem ((url, fileTitle), emptyTmp) =
where title = "Nowiny Andrychowskie - " ++ (replace " " "" fileTitle)
ext = extractFormat url
getDate :: String -> Maybe String
getDate url =
case url =~~ ("[0-1][1-9]-[0-9]{4}" :: String) of
date -> date
otherwise -> Just ""
getDate inputDate = Just (join "-" (reverse (split "-" inputDate)))
main = do
let start = "https://radioandrychow.pl/nowiny/"