diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Main.hs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/Main.hs b/app/Main.hs new file mode 100644 index 0000000..7c960b1 --- /dev/null +++ b/app/Main.hs @@ -0,0 +1,20 @@ +module Main (main) where + +import Data.Text +import MiniScalp.Predicates +import MiniScalp.Query +import MiniScalp.Sources +import MiniScalp.Types + +data MensaLine = MensaLine Text [Text] deriving (Show) + +source :: Text +source = "<!DOCTYPE html><html><div class=\"content\"><p>Hey <span id=\"username\">Alice</span>!</p></div></html>" + +nameScraper :: Scraper Text +nameScraper = chroot ("div" @: [hasClass "content"]) $ chroot ("span" @: ["id" @= "username"]) text + +main :: IO () +main = do + let scraped = scrapeText source nameScraper + print scraped |