Skip to content

Commit

Permalink
Merge branch 'feature-for-issue-JabRef#6189' of github.com:DD2480-gro…
Browse files Browse the repository at this point in the history
…up18/jabref into feature-for-issue-JabRef#6189
  • Loading branch information
LukasGutenberg committed Mar 4, 2021
2 parents 0a2857d + 9ac3f9b commit 3406ce0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/journal-data-generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import urllib3
import json

http = urllib3.PoolManager()

crossref_base_url = 'https://api.crossref.org/journals'

def crossref_with_ISSN(ISSN):
url = crossref_base_url + '/' + ISSN
print(url)
return http.request('GET', url)

# Test endpoint: https://api.crossref.org/journals/2158-5571
response = crossref_with_ISSN('2158-5571')
print(response.status)
# print(type(response.data))

data = json.loads(response.data.decode('utf-8'))

with open('data.json', 'w') as json_file:
json.dump(data, json_file)

0 comments on commit 3406ce0

Please sign in to comment.