Zaktualizuj 'app/best_robot.hs'

This commit is contained in:
Adrian Świderski 2022-04-14 16:29:11 +02:00
parent ecc16faa90
commit 88872ec6aa

View File

@ -12,13 +12,11 @@ import Text.Regex.Posix
import Text.Printf
extractRecords = extractLinksWithText "//a[@class='title']" -- pary adres-tytuł
>>> second (arr $ replace "\r\n " "")-- czyścimy drugi element pary, czyli tytuł z niepotrzebnych białych znaków
>>> first (extractLinksWithText "//a[@class='obj_galley_link 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)
-- ... a tutaj te trójki przerabiamy do docelowej struktury ShadowItem
toShadowItem :: ((String, String), String) -> ShadowItem
toShadowItem ((url, articleTitle), yearlyTitle) =