From 98e1b69b8b5ed9d95d27fed16547dc885399b0e5 Mon Sep 17 00:00:00 2001 From: Adrian Charkiewicz Date: Fri, 18 Mar 2022 01:46:52 +0100 Subject: [PATCH] Zaktualizuj 'app/swidnik.hs' --- app/swidnik.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/swidnik.hs b/app/swidnik.hs index 5bd1389..d9c87e0 100644 --- a/app/swidnik.hs +++ b/app/swidnik.hs @@ -13,7 +13,6 @@ swidnik extractRecords = extractLinksWithText "//a/div[@src='http://www.bibliotekaswidnik.pl/images/banners/pdf_klik.jpg"']" -- pary adres-tytuł >>> second (arr $ replace "\r\n " " ") -- czyścimy drugi element pary, czyli tytuł z niepotrzebnych białych znaków - >>> first (arr ((++"tr") . init)) -- modyfikujemy pierwszy element pary, czyli adres URL >>> first (extractLinksWithText "//li/a[contains(@href,'.pdf')]") -- pobieramy stronę z adresu URL i wyciągamy linki z tej strony pasujące do wyrażenia XPathowego -- ostatecznie wyjdą trójki ((adres URL, tytuł artykułu), tytuł rocznika) @@ -26,7 +25,7 @@ toShadowItem ((url, articleTitle), yearlyTitle) = format = Just "pdf", finalUrl = url } - where title = "Almanach Muszyny " ++ yearlyTitle ++ " " ++ (replace "\r\n" "" (replace "\r\n " "" articleTitle)) + where title = "Glos " ++ yearlyTitle ++ " " ++ (replace "\r\n" "" (replace "\r\n " "" articleTitle)) date = getDate url getDate url = @@ -38,8 +37,8 @@ getDate url = main = do let start = "s.bibliotekaswidnik.pl/index.php/116-glos-swidnika let shadowLibrary = ShadowLibrary {logoUrl=Nothing, - lname="Almanach Muszyny", - abbrev="AlmMusz", + lname="Glos", + abbrev="Glos", lLevel=0, webpage=start} extractItemsStartingFromUrl shadowLibrary start (extractRecords >>> arr toShadowItem)