def get_all_crossref_dois_for_an_issn(issn):
    crossref_api_page_number = 1
    crossref_api_page_size = 100
    dois = []
    while crossref_api_page_number:
        print("page {crossref_api_page_number}".format(
            issn=issn, crossref_api_page_number=crossref_api_page_number))
        url = "http://search.labs.crossref.org/dois?q={issn}&rows={page_size}&page={page}&header=true".format(
            issn=issn, page=crossref_api_page_number, page_size=crossref_api_page_size)
        #print url
        try:
            r = requests.get(url, timeout=10)
        except requests.Timeout:
            print "timeout"
            return []
        dois_on_page = [item["doi"] for item in r.json["items"]]
        #print dois_on_page
        dois += dois_on_page
        if crossref_api_page_number*crossref_api_page_size < r.json["totalResults"]:
            crossref_api_page_number = None
        else:
            crossref_api_page_number += 1
    return dois
dataset/ETHPy150Open Impactstory/total-impact-core/extras/db_housekeeping/build_collections_from_issn.py/get_all_crossref_dois_for_an_issn/operator `>` -> `<`