aboutsummaryrefslogtreecommitdiff
path: root/src/Parser
diff options
context:
space:
mode:
authorJoris2016-07-14 15:47:33 +0200
committerJoris2016-07-14 15:47:33 +0200
commitb846aa65f8f21189f39236f88908267167004a35 (patch)
treed0c553170d4df005797139f6f304b24818ff6c29 /src/Parser
parent69e69017b75d1cdaa1fd2aef2818de5111b29735 (diff)
Add isPro info
Diffstat (limited to 'src/Parser')
-rw-r--r--src/Parser/Resume.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Parser/Resume.hs b/src/Parser/Resume.hs
index f300ec3..8940be7 100644
--- a/src/Parser/Resume.hs
+++ b/src/Parser/Resume.hs
@@ -2,7 +2,8 @@ module Parser.Resume
( parse
) where
-import Data.Maybe (catMaybes)
+import Data.Maybe (catMaybes, isJust)
+import Data.List (find)
import Data.Text (Text)
import qualified Data.Text as T
@@ -26,4 +27,5 @@ parseResume item = do
name <- getTagTextAfter "<h2 class=item_title>" item
let price = getTagTextAfter "<h3 class=item_price>" item
url <- getTagAttribute "<a>" (T.pack "href") item
- return (Resume name price (T.concat [T.pack "https:", url]))
+ let isPro = isJust . find (~== "<span class=ispro>") $ item
+ return (Resume name price (T.concat [T.pack "https:", url]) isPro)