Commit 652a05b2 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[API] function name.

parent e3945410
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Isidore.Client
import Network.HTTP.Client (newManager)
import Network.HTTP.Client.TLS (tlsManagerSettings)
import Servant.Client
import Isidore
main :: IO ()
main = do
manager' <- newManager tlsManagerSettings
res <- runClientM
(clientIsidore
(Just 10)
(Just "poison")
(Nothing))
(mkClientEnv manager' $ BaseUrl Https "api.isidore.science" 443 "resource")
case res of
(Left err) -> print err
(Right val) -> print val
main = getMetadataWith "sociologie" (Just 10) >>= print
main2 :: IO ()
main2 = getMetadataWithAuthor "durkheim" (Just 10) >>= print
-- This file has been generated from package.yaml by hpack version 0.28.2.
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.31.2.
--
-- see: https://github.com/sol/hpack
--
-- hash: 37b28b3c7df7f52e571a3f00f87a54ca95eb656d9c0fbfe562bacbfcccb6ab6d
-- hash: 20866216943d8b360cc259814098391c4718e607e203a9e6d286b6df51fecf0b
name: crawlerIsidore
version: 0.1.0.0
......@@ -15,10 +17,9 @@ copyright: 2019 CNRS/IMT
license: BSD3
license-file: LICENSE
build-type: Simple
cabal-version: >= 1.10
extra-source-files:
ChangeLog.md
README.md
ChangeLog.md
source-repository head
type: git
......
......@@ -33,6 +33,13 @@ type Limit = Int
type TextQuery = Text
type AuthorQuery = Text
getMetadataWith :: Text -> Maybe Int -> IO (Either ServantError Content)
getMetadataWith q l = get l (Just q) Nothing
getMetadataWithAuthor :: Text -> Maybe Int -> IO (Either ServantError Content)
getMetadataWithAuthor q l = get l Nothing (Just q)
get :: Maybe Limit
-> Maybe TextQuery
-> Maybe AuthorQuery
......
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