diff options
author | Joris | 2016-11-14 21:47:10 +0100 |
---|---|---|
committer | Joris | 2016-11-14 21:47:10 +0100 |
commit | ae45764821dc3c04eeb8c2171f14d36256ce4027 (patch) | |
tree | 99d3d3f6bf78b03232d75ce9c10b0cffd979a28e /src/Fetch.hs | |
parent | d155bab73eb383753df4d267c7db584af44f3349 (diff) |
Warn log when no resume is parsed from search page
Diffstat (limited to 'src/Fetch.hs')
-rw-r--r-- | src/Fetch.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Fetch.hs b/src/Fetch.hs index c80a980..ea82caa 100644 --- a/src/Fetch.hs +++ b/src/Fetch.hs @@ -1,9 +1,12 @@ +{-# LANGUAGE OverloadedStrings #-} + module Fetch ( fetchResumes , fetchAds ) where import Data.Text (Text) +import qualified Data.Text.IO as T import Page @@ -16,7 +19,12 @@ import qualified Parser.Resume as Resume import qualified Parser.Detail as Detail fetchResumes :: URL -> IO (Either Text [Resume]) -fetchResumes url = fmap Resume.parse <$> Page.get url +fetchResumes url = do + resumes <- fmap Resume.parse <$> Page.get url + if null resumes + then T.putStrLn "Parsed 0 results!" + else return () + return resumes fetchAds :: [Resume] -> IO (Either Text [Ad]) fetchAds resumes = do |