aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Main.hs b/src/Main.hs
new file mode 100644
index 0000000..f352a43
--- /dev/null
+++ b/src/Main.hs
@@ -0,0 +1,27 @@
+module Main
+ ( main
+ ) where
+
+import Data.List (intersperse)
+
+import Ad (getAds)
+
+import Model.Ad
+
+import View.Ad (renderAd)
+
+import Page
+import Parser.Detail
+
+url :: String
+url = "http://www.leboncoin.fr/annonces/offres/corse/"
+
+main :: IO ()
+main = do
+ eitherAds <- getAds url
+ case eitherAds of
+ Left error ->
+ putStrLn error
+ Right ads -> do
+ writeFile "result.html" (concat . intersperse "\n\n" . map renderAd $ ads)
+ putStrLn "Done!"