forked from filipg/twilight-library
fix typos
This commit is contained in:
parent
5590d3d8ce
commit
45e471a312
@ -17,7 +17,7 @@ getLinkAndText xpathCondition = proc doc -> do
|
|||||||
name <- getElemName -< xpathTrees
|
name <- getElemName -< xpathTrees
|
||||||
txt <- (listA (deep isText >>> getText) >>> arr (intercalate " ")) -< xpathTrees
|
txt <- (listA (deep isText >>> getText) >>> arr (intercalate " ")) -< xpathTrees
|
||||||
href <- (getXPathTrees "//a" >>> getAttrValue "href") -< xpathTrees
|
href <- (getXPathTrees "//a" >>> getAttrValue "href") -< xpathTrees
|
||||||
returnA -< href, txt
|
returnA -< (href, txt)
|
||||||
|
|
||||||
|
|
||||||
extractNestedLinksWithText xpathCondition = proc url -> do
|
extractNestedLinksWithText xpathCondition = proc url -> do
|
||||||
@ -29,8 +29,8 @@ extractNestedLinksWithText xpathCondition = proc url -> do
|
|||||||
|
|
||||||
extractRecords = proc x -> do
|
extractRecords = proc x -> do
|
||||||
(a, b) <- extractLinksWithText "//aside[@class='widget widget_maxmegamenu']//a[@class='mega-menu-link']" -< x -- pary adres-tytuł podstrony
|
(a, b) <- extractLinksWithText "//aside[@class='widget widget_maxmegamenu']//a[@class='mega-menu-link']" -< x -- pary adres-tytuł podstrony
|
||||||
(a', b') <- (extractLinksWithText "//aside[@class='widget widget_maxmegamenu']//a[@class='mega-menu-link']") -< a -- pobieramy podstronę i kolejne podstrony z menu
|
(a', b') <- extractLinksWithText "//aside[@class='widget widget_maxmegamenu']//a[@class='mega-menu-link']" -< a -- pobieramy podstronę i kolejne podstrony z menu
|
||||||
a'' <- (extractNestedLinksWithText "//big[a[contains(@href,'.pdf')][img]]") -< a' -- pobieramy stronę z adresu URL i wyciągamy linki z tej strony pasujące do wyrażenia XPathowego
|
a'' <- extractNestedLinksWithText "(//big[a[contains(@href,'.pdf')][img]])[1]" -< a' -- pobieramy stronę z adresu URL i wyciągamy linki z tej strony pasujące do wyrażenia XPathowego
|
||||||
returnA -< ((a'', b'), b)
|
returnA -< ((a'', b'), b)
|
||||||
-- ostatecznie wyjdą krotki (((adres URL, tytuł nr-u), tytuł podstrony 2), tytuł podstrony 1)
|
-- ostatecznie wyjdą krotki (((adres URL, tytuł nr-u), tytuł podstrony 2), tytuł podstrony 1)
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ toShadowItem (((url, releaseTitle), collectionTitle), categoryTitle) =
|
|||||||
|
|
||||||
|
|
||||||
getDate yearlyTitle =
|
getDate yearlyTitle =
|
||||||
case yearlyTitle =~~ "/.+(19[0-9][0-9]|20[0-9][0-9])/" :: Maybe [[String]] of
|
case yearlyTitle =~~ "/(19[0-9][0-9]|20[0-9][0-9])/" :: Maybe [[String]] of
|
||||||
Just [[_, year]] -> year
|
Just [[_, year]] -> year
|
||||||
-- otherwise -> error $ "unexpected yearlyTitle: " ++ yearlyTitle
|
-- otherwise -> error $ "unexpected yearlyTitle: " ++ yearlyTitle
|
||||||
otherwise -> yearlyTitle
|
otherwise -> yearlyTitle
|
||||||
|
Loading…
Reference in New Issue
Block a user