forked from filipg/twilight-library
.
This commit is contained in:
parent
cc670f1f7c
commit
c77fe1a502
@ -13,18 +13,19 @@ import Text.Printf
|
|||||||
|
|
||||||
|
|
||||||
extractRecords = extractLinksWithText "//a[@class='image-link']" -- pary adres-tytuł
|
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
|
-- ... a tutaj te trójki przerabiamy do docelowej struktury ShadowItem
|
||||||
toShadowItem :: ((String, String),String) -> ShadowItem
|
toShadowItem :: ((String, String),String) -> ShadowItem
|
||||||
toShadowItem ((url, articleTitle), yearlyTitle) =
|
toShadowItem ((url, articleTitle), yearlyTitle) =
|
||||||
(defaultShadowItem url title) {
|
(defaultShadowItem url title) {
|
||||||
|
--originalDate = Just date,
|
||||||
itype = "periodical",
|
itype = "periodical",
|
||||||
format = Just "pdf",
|
format = Just "pdf",
|
||||||
finalUrl = url
|
finalUrl = url
|
||||||
}
|
}
|
||||||
where title = "Pbsociety "
|
where title = "Pbsociety " ++ yearlyTitle ++ " " ++ articleTitle
|
||||||
|
--date = getDate url
|
||||||
getDate url =
|
getDate url =
|
||||||
case url =~~ "/(19[0-9][0-9]|20[0-9][0-9])/" :: Maybe [[String]] of
|
case url =~~ "/(19[0-9][0-9]|20[0-9][0-9])/" :: Maybe [[String]] of
|
||||||
Just [[_, year]] -> year
|
Just [[_, year]] -> year
|
||||||
|
Loading…
Reference in New Issue
Block a user