Created
February 12, 2014 20:23
-
-
Save kreed131/8963802 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main = do | |
html <- getUrl "http://asd.com" | |
getThreadLinks html | |
getUrl url = snd <$> curlGetString url curlOpts | |
getThreadLinks s = do | |
xs <- runX $ (parseHtml s) >>> css "a" >>> getAttrValue "href" | |
return $ map ((++) ourUrl2) . extractEvery 3 $ filter (\y -> isInfixOf "threads/" y && isInfixOf "page" y && (not . isInfixOf "http") y) xs | |
extractEvery m = map snd . filter (\(x,y) -> mod x m == 0) . zip [1..] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment