diff options
author | Joris Guyonvarch | 2015-04-12 22:46:56 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-04-12 22:47:27 +0200 |
commit | 10a9aa9391ac2995527557d9d808693b57236603 (patch) | |
tree | d1aae79b86a7d289b5733519683302c712fe96da /src/Ad.hs | |
parent | 293fab1df23821b5f131603c4db56ab71681ce59 (diff) |
Ignore lines beginning with # in the configuration file
Diffstat (limited to 'src/Ad.hs')
-rw-r--r-- | src/Ad.hs | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1,6 +1,6 @@ module Ad - ( getResumes - , getAds + ( fetchResumes + , fetchAds ) where import Data.Text (Text) @@ -16,15 +16,15 @@ import Model.URL import Parser.Resume import Parser.Detail -getResumes :: URL -> IO (Either Text [Resume]) -getResumes url = fmap parseResumes <$> getPage url +fetchResumes :: URL -> IO (Either Text [Resume]) +fetchResumes url = fmap parseResumes <$> getPage url -getAds :: [Resume] -> IO (Either Text [Ad]) -getAds resumes = do - xs <- sequence $ map getAd resumes +fetchAds :: [Resume] -> IO (Either Text [Ad]) +fetchAds resumes = do + xs <- sequence $ map fetchAd resumes return $ sequence xs -getAd :: Resume -> IO (Either Text Ad) -getAd resume = do +fetchAd :: Resume -> IO (Either Text Ad) +fetchAd resume = do page <- getPage (url resume) fmap (\page -> Ad { resume = resume, detail = parseDetail page}) <$> getPage (url resume) |