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 NoImplicitPrelude #-}
13 {-# LANGUAGE OverloadedStrings #-}
14 {-# LANGUAGE DeriveGeneric #-}
16 module Gargantext.Text.Corpus.API
21 import GHC.Generics (Generic)
23 import Data.Text (Text)
24 import Gargantext.Prelude
25 --import qualified PUBMED as PubMed
26 import Test.QuickCheck.Arbitrary
27 import Test.QuickCheck (elements)
29 --import qualified Gargantext.Text.Corpus.API.Isidore as Isidore
32 data ExternalAPIs = ALL
36 | IsidoreQuery | IsidoreAuth
37 deriving (Show, Eq, Enum, Bounded, Generic)
39 instance FromJSON ExternalAPIs
40 instance ToJSON ExternalAPIs
43 externalAPIs :: [ExternalAPIs]
44 externalAPIs = [minBound..maxBound]
46 instance Arbitrary ExternalAPIs
48 arbitrary = elements externalAPIs
50 instance ToSchema ExternalAPIs
52 crawl :: Crawler -> Query -> IO [PubMed.Doc]
53 crawl Pubmed = PubMed.crawler