shpider 0.0.6 → 0.0.7
raw patch · 2 files changed
+12/−16 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Network/Shpider.hs +11/−15
- shpider.cabal +1/−1
Network/Shpider.hs view
@@ -72,18 +72,18 @@ gatherLinks ts fs = gatherForms ts- setCurrentPage $ emptyPage { addr = paddr }+ nPge = emptyPage { addr = paddr }+ -- seems weird, but this is the side effect needed here to create the absolute urls next+ setCurrentPage nPge+ maybeAbsFormActions <- mapM mkAbsoluteUrl $ map action fs maybeAbsLinkAddrs <- mapM mkAbsoluteUrl $ map linkAddress ls let absLinkAddrs = catMaybes maybeAbsLinkAddrs- let absLinks = zipWith ( \ laddr ltxt -> Link { linkAddress = laddr- , linkText = linkText ltxt- }- )- absLinkAddrs- ls- let newP = - Page { links = absLinks - , forms = fs+ absFormActions = catMaybes maybeAbsFormActions+ absFs = zipWith ( \ form a -> form { action = a }) fs absFormActions + absLinks = zipWith ( \ laddr l -> l { linkAddress = laddr }) absLinkAddrs ls+ newP = + nPge { links = absLinks + , forms = absFs , source = html , tags = ts , addr = paddr@@ -255,11 +255,7 @@ getFormsByAction a = do murl <- mkAbsoluteUrl a maybe ( return [ ] )- ( \ url -> do- fs <- currentForms- return $ filter ( (==) url . action )- fs- )+ ( \ url -> fmap (filter $ (==) url . action) currentForms ) murl -- | Get all links whose address matches this regex.
shpider.cabal view
@@ -1,5 +1,5 @@ Name: shpider -Version: 0.0.6+Version: 0.0.7 Synopsis: Web automation library in Haskell. Description: Shpider is a web automation library for Haskell. It allows you to quickly write crawlers, and for simple cases ( like following links ) even without reading the page source.