You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
488 B

import crossref_commons.retrieval as crossref
from _arango import ArangoDB
from time import sleep
arango = ArangoDB()
checked = arango.db.collection('dois_checked').all()
for doi in checked:
print(doi)
try:
crossref_data = crossref.get_publication_as_json(doi['doi'])
arango.db.collection('dois_checked').update({'_key': doi['_key'], 'crossref_data': crossref_data})
sleep(1)
except Exception as e:
print(e)
sleep(1)
continue