def get_doai_oa(doi):
""" Given a DOI, return DOAI target URL if green open access,
None otherwise.
"""
doaiurl = 'http://doai.io/{}'.format(doi)
try:
doai = SESSIONDOAI.head(url=doaiurl)
except requests.ConnectionError:
time.sleep(random.randint(1, 100))
return False
if doai.status_code == 302:
url = doai.headers['Location']
if re.search('doi.org', url):
return None
else:
return url
评论列表
文章目录