From 5709f552ddb71c082db9a202f76215cdd3a6a3ec Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 19 Apr 2015 13:33:40 +0200 Subject: Removing waitInMinutes from the configuration --- README.md | 4 ++-- src/AdListener.hs | 1 + src/Config.hs | 5 ----- src/Model/Config.hs | 1 - 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6bc9112..721f79e 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ url = http://www.leboncoin.fr/locations/offres/ile_de_france/?f=a&th=1 # The properties field is an optional list # properties = cp, city, surface, ges -# The waitInMinutes field is an optional integer, default to 1 -# waitInMinutes = 60 +# The waitDurationInMinutes field is an optional integer, default to 1 +# waitDurationInMinutes = 60 ``` Email diff --git a/src/AdListener.hs b/src/AdListener.hs index eee2de4..a52e188 100644 --- a/src/AdListener.hs +++ b/src/AdListener.hs @@ -8,6 +8,7 @@ import Data.List (intersperse) import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.IO as T +import Data.Time.Clock (getCurrentTime, diffUTCTime, UTCTime) import Control.Concurrent (threadDelay) diff --git a/src/Config.hs b/src/Config.hs index e4b2bc6..39ff185 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -36,7 +36,6 @@ configUsage = , " - url (required)" , " - mailTo (optional)" , " - properties (optional)" - , " - waitInMinutes (optional, default to 1)" , "" , " Example:" , "" @@ -50,9 +49,6 @@ configUsage = , "" , " # The properties field is an optional list" , " # properties = cp, city, surface, ges" - , "" - , " # The waitInMinutes field is an optional integer, default to 1" - , " # waitInMinutes = 60" ] configPath :: FilePath @@ -86,7 +82,6 @@ configFromMap map = do { url = url , mailTo = fieldValues "mailTo" map , properties = fieldValues "properties" map - , waitInMinutes = fromMaybe 1 $ M.lookup "waitInMinutes" map >>= fmap fst . eitherToMaybe . decimal } return config diff --git a/src/Model/Config.hs b/src/Model/Config.hs index 8fb05b9..42b390e 100644 --- a/src/Model/Config.hs +++ b/src/Model/Config.hs @@ -10,5 +10,4 @@ data Config = Config { url :: URL , mailTo :: [Text] , properties :: [Text] - , waitInMinutes :: Int } deriving (Eq, Read, Show) -- cgit v1.2.3