Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
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
haskell-gargantext
Commits
7477cf9b
Commit
7477cf9b
authored
Mar 03, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[scrapers] fix limit with MAX_DOCS_SCRAPERS
parent
ba645886
Pipeline
#2532
failed with stage
in 43 minutes
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
API.hs
src/Gargantext/Core/Text/Corpus/API.hs
+6
-10
No files found.
src/Gargantext/Core/Text/Corpus/API.hs
View file @
7477cf9b
...
...
@@ -31,10 +31,6 @@ import qualified Gargantext.Core.Text.Corpus.API.Istex as ISTEX
import
qualified
Gargantext.Core.Text.Corpus.API.Pubmed
as
PUBMED
import
Servant.Client
(
ClientError
)
-- | TODO put in gargantext.init
default_limit
::
Maybe
Integer
default_limit
=
Just
10000
-- | Get External API metadata main function
get
::
ExternalAPIs
->
Lang
...
...
@@ -42,15 +38,15 @@ get :: ExternalAPIs
->
Maybe
Limit
-- -> IO [HyperdataDocument]
->
IO
(
Either
ClientError
(
Maybe
Integer
,
ConduitT
()
HyperdataDocument
IO
()
))
get
PubMed
_la
q
_l
=
PUBMED
.
get
q
Nothing
get
PubMed
_la
q
limit
=
PUBMED
.
get
q
limit
--docs <- PUBMED.get q default_limit -- EN only by default
--pure (Just $ fromIntegral $ length docs, yieldMany docs)
get
HAL
la
q
_l
=
HAL
.
getC
la
q
Nothing
get
IsTex
la
q
_l
=
do
docs
<-
ISTEX
.
get
la
q
default_
limit
get
HAL
la
q
limit
=
HAL
.
getC
la
q
limit
get
IsTex
la
q
limit
=
do
docs
<-
ISTEX
.
get
la
q
limit
pure
$
Right
(
Just
$
fromIntegral
$
length
docs
,
yieldMany
docs
)
get
Isidore
la
q
_l
=
do
docs
<-
ISIDORE
.
get
la
(
fromIntegral
<$>
default_
limit
)
(
Just
q
)
Nothing
get
Isidore
la
q
limit
=
do
docs
<-
ISIDORE
.
get
la
(
fromIntegral
<$>
limit
)
(
Just
q
)
Nothing
pure
$
Right
(
Just
$
fromIntegral
$
length
docs
,
yieldMany
docs
)
get
_
_
_
_
=
undefined
...
...
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