Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
crawlers
searx
Commits
711abfab
Commit
711abfab
authored
Sep 23, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work together
parent
a8a0f838
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
SEARX.hs
src/SEARX.hs
+11
-9
No files found.
src/SEARX.hs
View file @
711abfab
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment