SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
6631e9da
Commit
6631e9da
authored
7 years ago
by
Geert Kapteijns
Browse files
Options
Downloads
Patches
Plain Diff
finish simpler version of arxiv caller
parent
012845eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scipost/services.py
+12
-22
12 additions, 22 deletions
scipost/services.py
with
12 additions
and
22 deletions
scipost/services.py
+
12
−
22
View file @
6631e9da
...
@@ -79,33 +79,23 @@ class ArxivCaller:
...
@@ -79,33 +79,23 @@ class ArxivCaller:
request
=
requests
.
get
(
url
)
request
=
requests
.
get
(
url
)
if
request
.
ok
:
if
request
.
ok
:
self
.
is_valid
=
True
self
.
is_valid
=
True
self
.
_arxiv_data
=
feedparser
.
parse
(
request
.
content
)
self
.
_arxiv_data
=
feedparser
.
parse
(
request
.
content
)
[
'
entries
'
][
0
]
else
:
else
:
self
.
is_valid
=
False
self
.
is_valid
=
False
def
_format_data
(
self
):
def
_format_data
(
self
):
raise
NotImplementedError
data
=
self
.
_arxiv_data
pub_title
=
data
[
'
title
'
]
author_list
=
[
author
[
'
name
'
]
for
author
in
data
[
'
authors
'
]]
# metadata = caller.metadata
arxiv_link
=
data
[
'
id
'
]
# pub_title = metadata['entries'][0]['title']
abstract
=
data
[
'
summary
'
]
# authorlist = metadata['entries'][0]['authors'][0]['name']
# for author in metadata['entries'][0]['authors'][1:]:
# authorlist += ', ' + author['name']
# arxiv_link = metadata['entries'][0]['id']
# abstract = metadata['entries'][0]['summary']
#
# initialdata = {
# 'type': 'preprint',
# 'metadata': metadata,
# 'pub_title': pub_title,
# 'author_list': authorlist,
# 'arxiv_identifier': identifierform.cleaned_data['identifier'],
# 'arxiv_link': arxiv_link,
# 'pub_abstract': abstract
# }
self
.
data
=
{
'
pub_title
'
:
pub_title
,
'
author_list
'
:
author_list
,
'
arxiv_link
'
:
arxiv_link
,
'
pub_abstract
'
:
abstract
,
}
# I'm going to revamp this whole thing...
# I'm going to revamp this whole thing...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment