From 0d06e9dc3db155586afa6ca310ce0fe697588400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kolasin=CC=81ski?= Date: Sat, 10 Apr 2021 11:05:32 +0200 Subject: [PATCH] Fix fate format --- app/naszepopowice.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/naszepopowice.hs b/app/naszepopowice.hs index 9c57617..0e3f567 100644 --- a/app/naszepopowice.hs +++ b/app/naszepopowice.hs @@ -18,14 +18,13 @@ toShadowItem (url, articleTitle) = (defaultShadowItem url title) { originalDate = Just date, itype = "periodical", - format = Just "pdf", - finalUrl = url + format = Just "pdf" } where title = "Nasze Popowice " ++ getNr url date = getDate url replaceSeparatorWithSpace = map (\c -> if c=='_' then ' '; else if c=='-' then ' '; else c) -replaceSeparatorWithDot = map (\c -> if c=='_' then '.'; else c) +replaceUnderscoreWithDash = map (\c -> if c=='_' then '-'; else c) getNr url = case url =~~ "nr[-_][0-9][0-9]" :: Maybe String of @@ -34,7 +33,7 @@ getNr url = getDate url = case url =~~ "20[0-9][0-9]_[0-1][0-9]" :: Maybe String of - Just date -> replaceSeparatorWithDot date + Just date -> replaceUnderscoreWithDash date otherwise -> error $ "unexpected url: " ++ url