Created
February 18, 2016 23:19
-
-
Save rpglover64/f668ed372c63e271cf15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import System.Environment | |
import Network.HTTP | |
main :: IO () | |
main = do | |
url <- fmap head getArgs | |
r <- simpleHTTP $ getRequest url | |
getResponseBody r >>= putStrLn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Text.HTML.Scalpel | |
import Data.List | |
import Data.Maybe | |
import System.Environment | |
main :: IO () | |
main = do | |
url <- fmap head getArgs | |
mhtml <- scrapeURL url $ html "html" | |
maybe (putStrLn "Fail") putStrLn mhtml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Network.Wreq | |
import Data.Aeson.Lens | |
import Control.Lens | |
import qualified Data.ByteString.Lazy as B | |
import System.Environment | |
main :: IO () | |
main = do | |
url <- fmap head getArgs | |
r <- get url | |
B.putStrLn $ r ^. responseBody |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment