Commit 711abfab authored by Alexandre Delanoë's avatar Alexandre Delanoë

work together

parent a8a0f838
......@@ -31,24 +31,26 @@ getMetadataWith2 q = do
runClientM
(search (Just q) (Just 1) (Just 3) (Just "") (Just All) (Just Json))
(mkClientEnv manager' $ BaseUrl Https "search.iscpif.fr" 443 "")
{--
read($url, function(err, article, meta) {
// Title
article.close();
-}
parseWebsite :: T.Text -> IO Int
parseWebsite :: T.Text -> IO T.Text
parseWebsite url =
withSystemTempDirectory "" $ \tmpdir -> do
withCurrentDirectory tmpdir $
traverse_
callCommand
["npm init --yes", "npm install --save node-readability"]
[ "npm init --yes"
, "npm install --save readability"
-- , "npm install --save node-readability"
]
withJSSession
defJSSessionOpts {nodeWorkDir = Just tmpdir}
[block|
return 12;
});
const read = (await import("readability")).default,
reader = new Readability("<body>bal<title>title</title></body>").parse();
return reader.title;
|]
specConcatEith :: Semigroup a => Either b a -> Either b a -> Either b a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment