From c77fe1a5025ddf7028e54677382c76109c206c96 Mon Sep 17 00:00:00 2001 From: s434695 Date: Mon, 19 Apr 2021 23:58:35 +0200 Subject: [PATCH] . --- app/pbsociety.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/pbsociety.hs b/app/pbsociety.hs index 7692762..749d611 100644 --- a/app/pbsociety.hs +++ b/app/pbsociety.hs @@ -13,18 +13,19 @@ import Text.Printf extractRecords = extractLinksWithText "//a[@class='image-link']" -- pary adres-tytuł - >>> first (extractLinksWithText "//div/a[contains(@href,'.pdf') and not(@class)]") + >>> first (extractLinksWithText "//div/a[contains(@href,'.pdf') and not(@class)]") -- ... a tutaj te trójki przerabiamy do docelowej struktury ShadowItem toShadowItem :: ((String, String),String) -> ShadowItem toShadowItem ((url, articleTitle), yearlyTitle) = (defaultShadowItem url title) { + --originalDate = Just date, itype = "periodical", format = Just "pdf", finalUrl = url } - where title = "Pbsociety " - + where title = "Pbsociety " ++ yearlyTitle ++ " " ++ articleTitle + --date = getDate url getDate url = case url =~~ "/(19[0-9][0-9]|20[0-9][0-9])/" :: Maybe [[String]] of Just [[_, year]] -> year