Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
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
hal
Commits
763cdefc
Commit
763cdefc
authored
Mar 04, 2019
by
Mael NICOLAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WIP] Basic /search/fl using Text as Type
parent
38ec795a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
2 deletions
+40
-2
Main.hs
app/Main.hs
+13
-2
package.yaml
package.yaml
+6
-0
Client.hs
src/Client.hs
+2
-0
Client.hs
src/HAL/Client.hs
+19
-0
No files found.
app/Main.hs
View file @
763cdefc
module
Main
where
module
Main
where
import
Lib
import
Network.HTTP.Client
(
newManager
)
import
Network.HTTP.Client.TLS
(
tlsManagerSettings
)
import
Servant.Client
import
HAL.Client
main
::
IO
()
main
::
IO
()
main
=
someFunc
main
=
do
manager'
<-
newManager
tlsManagerSettings
res
<-
runClientM
(
fl
Nothing
)
(
mkClientEnv
manager'
$
BaseUrl
Https
"api.archives-ouvertes.fr"
443
"search"
)
case
res
of
(
Left
err
)
->
print
err
(
Right
val
)
->
print
val
package.yaml
View file @
763cdefc
...
@@ -21,6 +21,12 @@ description: Please see the README on GitHub at <https://github.com/gith
...
@@ -21,6 +21,12 @@ description: Please see the README on GitHub at <https://github.com/gith
dependencies
:
dependencies
:
-
base >= 4.7 && < 5
-
base >= 4.7 && < 5
-
servant
-
servant-client
-
aeson
-
http-client-tls
-
http-client
-
text
library
:
library
:
source-dirs
:
src
source-dirs
:
src
...
...
src/Client.hs
0 → 100644
View file @
763cdefc
module
Client
where
src/HAL/Client.hs
0 → 100644
View file @
763cdefc
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
module
HAL.Client
where
import
Data.Proxy
import
GHC.Generics
import
Servant.API
import
Servant.Client
import
Data.Text
type
HALAPI
=
""
:>
QueryParam
"fl"
Text
:>
Get
'[
J
SON
]
[
Text
]
halAPI
::
Proxy
HALAPI
halAPI
=
Proxy
fl
::
Maybe
Text
->
ClientM
[
Text
]
fl
=
client
halAPI
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