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