forked from filipg/twilight-library
Zaktualizuj 'app/swidnik.hs'
This commit is contained in:
parent
a2bed0a113
commit
ebfaa72b53
@ -1,10 +1,3 @@
|
||||
|
||||
1.9 KiB
|
||||
Czysty
|
||||
Bezpośredni odnośnik
|
||||
Wina
|
||||
Historia
|
||||
|
||||
{-# LANGUAGE Arrows, NoMonomorphismRestriction #-}
|
||||
import ShadowLibrary.Core
|
||||
|
||||
@ -16,9 +9,9 @@ import Data.List.Utils (replace)
|
||||
|
||||
import Text.Regex.Posix
|
||||
import Text.Printf
|
||||
swidnik
|
||||
|
||||
|
||||
extractRecords = extractLinksWithText "//a[@class='roczniki']" -- pary adres-tytuł
|
||||
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
|
||||
@ -43,7 +36,7 @@ getDate url =
|
||||
|
||||
|
||||
main = do
|
||||
let start = "http://www.almanachmuszyny.pl/"
|
||||
let start = "s.bibliotekaswidnik.pl/index.php/116-glos-swidnika
|
||||
let shadowLibrary = ShadowLibrary {logoUrl=Nothing,
|
||||
lname="Almanach Muszyny",
|
||||
abbrev="AlmMusz",
|
||||
|
Loading…
Reference in New Issue
Block a user