twilight-library/README.md

12 lines
1016 B
Markdown
Raw Permalink Normal View History

2021-03-30 22:45:49 +02:00
# Zadanie "robot haskell"
## Przykładowy output:
```ShadowItem {url = Just "https://aneks.kulturaliberalna.pl/wp-content/uploads/2016/02/51%C3%94%C3%87%C3%B452-With-Watermark.pdf", title = "Aneks Nr 51\8211\&52 1988", itype = "periodical", originalDate = Just "2016", creator = Nothing, format = Just "pdf", lang = Just "pol", finalUrl = "https://aneks.kulturaliberalna.pl/wp-content/uploads/2016/02/51%C3%94%C3%87%C3%B452-With-Watermark.pdf", description = Nothing}```
2021-03-30 22:45:49 +02:00
## Ekstrakcja info o .pdf ze strony https://aneks.kulturaliberalna.pl/archiwum-aneksu/:
```haskell
extractRecords = extractLinksWithText "//a[contains(@title,'Aneks') and contains(text(),'Nr')]"
>>> second (arr $ replace "\n" "")
2021-03-30 22:45:49 +02:00
>>> first (extractLinksWithText "//div/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? ((Link, tekst: "Wyświetl cały numer"), Numer Magazynu)```