From 430c17097cba8c970c2826be0e622b6cb7bb6818 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sat, 2 Dec 2023 11:52:18 +0100 Subject: head commit --- app/Main.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/Main.hs (limited to 'app') 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 = "

Hey Alice!

" + +nameScraper :: Scraper Text +nameScraper = chroot ("div" @: [hasClass "content"]) $ chroot ("span" @: ["id" @= "username"]) text + +main :: IO () +main = do + let scraped = scrapeText source nameScraper + print scraped -- cgit v1.2.3