2 Module : Gargantext.Text.Corpus.API
3 Description : All crawlers of Gargantext in one file.
4 Copyright : (c) CNRS, 2017
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
12 {-# LANGUAGE InstanceSigs #-}
14 module Gargantext.Text.Corpus.API
24 import Gargantext.API.Admin.Orchestrator.Types (ExternalAPIs(..), externalAPIs)
25 import Gargantext.Core (Lang(..))
26 import Gargantext.Database.Admin.Types.Hyperdata (HyperdataDocument(..))
27 import Gargantext.Prelude
28 import qualified Gargantext.Text.Corpus.API.Hal as HAL
29 import qualified Gargantext.Text.Corpus.API.Isidore as ISIDORE
30 import qualified Gargantext.Text.Corpus.API.Istex as ISTEX
31 import qualified Gargantext.Text.Corpus.API.Pubmed as PUBMED
33 -- | Get External API metadata main function
38 -> IO [HyperdataDocument]
39 get PubMed _la q l = PUBMED.get q l -- EN only by default
40 get HAL la q l = HAL.get la q l
41 get IsTex la q l = ISTEX.get la q l
42 get Isidore la q l = ISIDORE.get la (fromIntegral <$> l) (Just q) Nothing
43 get _ _ _ _ = undefined
45 -- | Some Sugar for the documentation
46 type Query = PUBMED.Query
47 type Limit = PUBMED.Limit