def create_issn_collections(publishers_dict, title_template, items_per_collection, api_url):
    collection_ids = []
    for publisher in publishers_dict:
        print "\n***", publisher
        for journal in publishers_dict[publisher]["journals"]:
            print "\n", journal
            title = title_template.format(
                issn=journal["issn"], title=journal["title"], publisher=publisher)
            issn_dois = get_all_crossref_dois_for_an_issn(journal["issn"])
            print("got {num} dois".format(
                num = len(issn_dois)))
            if issn_dois:
                dois_in_pages = [issn_dois[i:i+items_per_collection] for i in xrange(0, len(issn_dois), items_per_collection)]
                for dois_for_collection in dois_in_pages:
                    #print dois
                    if True:
                        collection_id = make_collection("doi", dois_for_collection, title, api_url)
                        print title        
                        collection_ids.append(collection_id)
                        print "sleeping to let collection get made slowly\n"
                        time.sleep(30)  #seconds
    return(collection_ids)


# export API_ROOT=total-impact-core.herokuapp.com
# export API_ROOT=total-impact-core-staging.herokuapp.com


#api_url = "http://" + os.getenv("API_ROOT")
dataset/ETHPy150Open Impactstory/total-impact-core/extras/db_housekeeping/build_collections_from_issn.py/create_issn_collections/original