aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
blob: 82135a2edc7bdc60df79be7316d61d944566026c (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
28
29
30
31
32
33
{-# LANGUAGE OverloadedStrings #-}

module Main
  ( main
  ) where

import qualified Data.Text.IO as T

import AdListener (listenToNewAds)

import Config (Config)
import qualified Config as C

main :: IO ()
main = do
  maybeConfig <- C.getConfig
  case maybeConfig of
    Just config ->
      listenToNewAds config
    Nothing ->
      T.putStrLn C.configUsage

-- import Page
-- import Parser.Detail

-- main :: IO ()
-- main = do
--   eitherPage <- getPage "http://www.leboncoin.fr/locations/794858813.htm?ca=18_s"
--   case eitherPage of
--     Right page ->
--       putStrLn (show $ parseDetail page)
--     Left error ->
--       T.putStrLn error