~alcinnz/hurl

ref: d2f173e2498b50a1bd526d3c696468846f63bb0a hurl/Main.hs -rw-r--r-- 478 bytes
d2f173e2 — Adrian Cochrane Merge branch 'main' of git.argonaut-constellation.org:~alcinnz/hurl into main 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Main where

import Network.URI.Fetch
-- Input parsing
import System.Environment (getArgs)
import Network.URI (parseURI, nullURI)
import Data.Maybe (catMaybes)
-- Where to save files
import System.Directory (getCurrentDirectory)

main :: IO ()
main = do
    urls <- getArgs
    let urls' = catMaybes $ map parseURI urls
    session <- newSession
    dir <- getCurrentDirectory

    res <- fetchURLs session ["*/*"] urls' $ saveDownload nullURI dir
    putStrLn $ show res