Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arxiv-api
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
gargantext
crawlers
arxiv-api
Commits
357bb9a1
Commit
357bb9a1
authored
Mar 31, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests
parent
3c80b872
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Arxiv.hs
src/Arxiv.hs
+9
-2
No files found.
src/Arxiv.hs
View file @
357bb9a1
...
@@ -22,6 +22,11 @@ import qualified Network.Api.Arxiv as Ax
...
@@ -22,6 +22,11 @@ import qualified Network.Api.Arxiv as Ax
------------------------------------------------------------
------------------------------------------------------------
type
Limit
=
Int
type
Limit
=
Int
type
Soup
=
Tag
String
------------------------------------------------------------
-- apiTotal_simple :: [String] -> IO Int
------------------------------------------------------------
------------------------------------------------------------
-- | Simple Query search for terms in All fields
-- | Simple Query search for terms in All fields
...
@@ -45,10 +50,9 @@ complexQuery =
...
@@ -45,10 +50,9 @@ complexQuery =
in
Ax
.
Query
{
Ax
.
qExp
=
Just
$
Exp
$
All
[
"nuclear fusion"
,
"plasma"
]
in
Ax
.
Query
{
Ax
.
qExp
=
Just
$
Exp
$
All
[
"nuclear fusion"
,
"plasma"
]
,
Ax
.
qIds
=
[]
,
Ax
.
qIds
=
[]
,
Ax
.
qStart
=
0
,
Ax
.
qStart
=
0
,
Ax
.
qItems
=
25
,
Ax
.
qItems
=
50
}
}
type
Soup
=
Tag
String
execQuery
::
Maybe
Limit
->
Ax
.
Query
->
IO
[
Result
]
execQuery
::
Maybe
Limit
->
Ax
.
Query
->
IO
[
Result
]
execQuery
Nothing
q
=
C
.
runConduitRes
(
searchAxv
q
.|
CL
.
consume
)
execQuery
Nothing
q
=
C
.
runConduitRes
(
searchAxv
q
.|
CL
.
consume
)
...
@@ -102,6 +106,7 @@ data Result = Result { doi :: String
...
@@ -102,6 +106,7 @@ data Result = Result { doi :: String
,
year
::
String
,
year
::
String
,
title
::
String
,
title
::
String
,
abstract
::
String
,
abstract
::
String
,
total
::
Int
}
deriving
(
Show
)
}
deriving
(
Show
)
mkResult
::
[
Soup
]
->
Result
mkResult
::
[
Soup
]
->
Result
...
@@ -115,11 +120,13 @@ mkResult sp = let doi' = Ax.getDoi sp
...
@@ -115,11 +120,13 @@ mkResult sp = let doi' = Ax.getDoi sp
year'
=
Ax
.
getYear
sp
year'
=
Ax
.
getYear
sp
title'
=
Ax
.
getTitle
sp
&
clean'
title'
=
Ax
.
getTitle
sp
&
clean'
abstract'
=
Ax
.
getSummary
sp
&
clean'
abstract'
=
Ax
.
getSummary
sp
&
clean'
total'
=
Ax
.
totalResults
sp
in
(
Result
doi'
url'
in
(
Result
doi'
url'
primaryCategory'
categories'
primaryCategory'
categories'
journal'
authors'
journal'
authors'
publication_date'
year'
publication_date'
year'
title'
abstract'
title'
abstract'
total'
)
)
where
clean'
x
=
let
x'
=
clean
[
'
\n
'
,
'
\r
'
,
'
\t
'
]
x
where
clean'
x
=
let
x'
=
clean
[
'
\n
'
,
'
\r
'
,
'
\t
'
]
x
in
if
null
x'
then
"Not found"
else
x'
in
if
null
x'
then
"Not found"
else
x'
...
...
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