Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2534 and #2535 Test in wikipedia and arxiv #2536

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scholia/arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def get_metadata(arxiv):
>>> metadata = get_metadata('1503.00759')
>>> metadata['doi'] == '10.1109/JPROC.2015.2483592'
True
>>> get_metadata('5432.01234')
{'error': 'Not found'}
>>> 'error' in get_metadata('5432.01234')
True

"""
arxiv = arxiv.strip()
Expand Down
3 changes: 2 additions & 1 deletion scholia/wikipedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def q_to_bibliography_templates(q):
query = BIBLIOGRAPHY_SPARQL_QUERY.format(q=q)
url = SPARQL_ENDPOINT
params = {'query': query, 'format': 'json'}
response = requests.get(url, params=params)
headers = {'User-Agent': config['requests'].get('user_agent')}
response = requests.get(url, params=params, headers=headers)
data = response.json()

wikitext = ('<!-- Generated with scholia.wikipedia '
Expand Down
Loading