From b7f0e2cf38195b40beefb2aaeffb3d796b8d6cd7 Mon Sep 17 00:00:00 2001 From: wiktor7245 Date: Fri, 16 Apr 2021 13:04:05 +0200 Subject: [PATCH] changed print method for originalDate --- app/mojrobot.hs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/mojrobot.hs b/app/mojrobot.hs index 1081016..84aea69 100644 --- a/app/mojrobot.hs +++ b/app/mojrobot.hs @@ -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/"