blob: f352a43af9e1efe49b0dbb0b1a4482f4f1635fdf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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!"
|