Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
isidore
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
isidore
Commits
652a05b2
Commit
652a05b2
authored
Aug 28, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] function name.
parent
e3945410
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
19 deletions
+17
-19
Main.hs
app/Main.hs
+5
-15
crawlerIsidore.cabal
crawlerIsidore.cabal
+5
-4
Isidore.hs
src/Isidore.hs
+7
-0
No files found.
app/Main.hs
View file @
652a05b2
{-# 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
crawlerIsidore.cabal
View file @
652a05b2
-- 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
...
...
src/Isidore.hs
View file @
652a05b2
...
...
@@ -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
...
...
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