first commit
This commit is contained in:
commit
7105cc28d2
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.hi
|
||||||
|
*.o
|
||||||
|
dictfr
|
10
Download.hs
Normal file
10
Download.hs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
module Download (downloadHtmlDef) where
|
||||||
|
|
||||||
|
import Network.HTTP
|
||||||
|
|
||||||
|
baseUrl = "http://www.cnrtl.fr/definition/"
|
||||||
|
|
||||||
|
downloadHtmlDef :: String -> IO String
|
||||||
|
downloadHtmlDef w =
|
||||||
|
simpleHTTP (req) >>= getResponseBody
|
||||||
|
where req = getRequest (baseUrl ++ w)
|
10
Main.hs
Normal file
10
Main.hs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
module Main where
|
||||||
|
|
||||||
|
import System.Environment
|
||||||
|
import Download
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = do
|
||||||
|
args <- getArgs
|
||||||
|
htmlResult <- downloadHtmlDef (head args)
|
||||||
|
putStrLn htmlResult
|
1
README.md
Normal file
1
README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
A command line tool to search for french word definition.
|
Loading…
Reference in New Issue
Block a user