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
0
Issues
0
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
Przemyslaw Kaminski
hal
Commits
6a74498b
Commit
6a74498b
authored
Mar 07, 2019
by
Mael NICOLAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WIP] Implement basic fq
Todo better type this
parent
5df9762f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
Main.hs
app/Main.hs
+1
-1
Client.hs
src/HAL/Client.hs
+7
-1
No files found.
app/Main.hs
View file @
6a74498b
...
...
@@ -12,7 +12,7 @@ main :: IO ()
main
=
do
manager'
<-
newManager
tlsManagerSettings
res
<-
runClientM
(
search
[
"docid"
]
(
asc
"docid"
))
(
search
[
"docid"
]
[
"docType_s:(THESE OR HDR)"
]
(
asc
"docid"
))
(
mkClientEnv
manager'
$
BaseUrl
Https
"api.archives-ouvertes.fr"
443
""
)
case
res
of
(
Left
err
)
->
print
err
...
...
src/HAL/Client.hs
View file @
6a74498b
...
...
@@ -18,6 +18,9 @@ type HALAPI = Search
type
Search
=
"search"
-- fl determine which fields will be returned it can be a list of fields or *
:>
QueryParams
"fl"
Text
-- TODO: type this monster
-- fq is to filter request
:>
QueryParams
"fq"
Text
-- preatty much clear, (Asc || Desc) + field you want to sort by
:>
QueryParam
"sort"
SortField
:>
Get
'[
J
SON
]
Response
...
...
@@ -56,5 +59,8 @@ instance FromJSON Doc
halAPI
::
Proxy
HALAPI
halAPI
=
Proxy
search
::
[
Text
]
->
Maybe
SortField
->
ClientM
Response
search
::
[
Text
]
->
[
Text
]
->
Maybe
SortField
->
ClientM
Response
search
=
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