diff options
Diffstat (limited to 'src/Ad.hs')
-rw-r--r-- | src/Ad.hs | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,19 +1,22 @@ module Ad ( getAds + , getResumes ) where -import Text.HTML.TagSoup (parseTags) - import Page (getPage) import Model.Ad import Model.Resume import Model.Detail +import Model.URL import Parser.Resume import Parser.Detail -getAds :: String -> IO (Either String [Ad]) +getResumes :: URL -> IO (Either String [Resume]) +getResumes url = fmap parseResumes <$> getPage url + +getAds :: URL -> IO (Either String [Ad]) getAds url = do eitherPage <- getPage url case eitherPage of @@ -30,4 +33,4 @@ getAdsFromPage page = do getAd :: Resume -> IO (Either String Ad) getAd resume = do page <- getPage (url resume) - fmap (\page -> Ad { resume = resume, detail = parseDetail (parseTags page)}) <$> getPage (url resume) + fmap (\page -> Ad { resume = resume, detail = parseDetail page}) <$> getPage (url resume) |