tagsoup 0.11.1 → 0.12
raw patch · 3 files changed
+22/−10 lines, 3 filesdep +directorydep +processdep −HTTPdep −mtldep ~QuickCheckdep ~deepseq
Dependencies added: directory, process
Dependencies removed: HTTP, mtl
Dependency ranges changed: QuickCheck, deepseq
Files
- TagSoup/Sample.hs +17/−3
- Text/HTML/TagSoup.hs +1/−1
- tagsoup.cabal +4/−6
TagSoup/Sample.hs view
@@ -2,15 +2,29 @@ module TagSoup.Sample where import Text.HTML.TagSoup-import Network.HTTP +import Control.Exception+import Control.Monad import Data.Char import Data.List+import System.Cmd+import System.Directory+import System.Exit+import System.IO openItem :: String -> IO String-openItem x | "http://" `isPrefixOf` x = getResponseBody =<< simpleHTTP (getRequest x)- | otherwise = readFile x+openItem url | not $ "http://" `isPrefixOf` url = readFile url+openItem url = bracket+ (openTempFile "." "tagsoup.tmp")+ (\(file,hndl) -> removeFile file)+ $ \(file,hndl) -> do+ hClose hndl+ putStrLn $ "Downloading: " ++ url+ res <- system $ "wget " ++ url ++ " -O " ++ file+ when (res /= ExitSuccess) $ error $ "Failed to download using wget: " ++ url+ src <- readFile file+ length src `seq` return src grab :: String -> IO ()
Text/HTML/TagSoup.hs view
@@ -34,7 +34,7 @@ sections, partitions, -- * Combinators- TagRep, (~==),(~/=)+ TagRep(..), (~==),(~/=) ) where import Text.HTML.TagSoup.Type
tagsoup.cabal view
@@ -1,6 +1,6 @@ cabal-version: >= 1.6 name: tagsoup-version: 0.11.1+version: 0.12 copyright: Neil Mitchell 2006-2010 author: Neil Mitchell <ndmitchell@gmail.com> maintainer: Neil Mitchell <ndmitchell@gmail.com>@@ -25,12 +25,11 @@ description: Build the test program flag download- default: True+ default: False description: Build with Download module library- ghc-options: -O2- build-depends: base == 4.*, mtl, containers, bytestring+ build-depends: base == 4.*, containers, bytestring if flag(download) build-depends: network@@ -53,10 +52,9 @@ Text.HTML.TagSoup.Type executable tagsoup- ghc-options: -O2 if flag(testprog) buildable: True- build-depends: QuickCheck == 2.1.*, time, deepseq == 1.1.0.0, HTTP+ build-depends: QuickCheck == 2.4.*, time, deepseq == 1.1.*, directory, process else buildable: False