示例#1
0
文件: views.py 项目: a3nm/oadoi
def get_publication_biblio_endpoint():
    request_biblio = {}
    for (k, v) in request.args.iteritems():
        request_biblio[k] = v
    my_collection = product.run_collection_from_biblio(g.use_cache,
                                                       **request_biblio)
    return jsonify({"results": my_collection.to_dict()})
示例#2
0
def get_doi_redirect_endpoint(doi):
    if not doi or not doi.startswith("10."):
        return index_endpoint()  # serve the angular app

    request_biblio = {"doi": doi}
    my_collection = product.run_collection_from_biblio(g.use_cache, **request_biblio)
    my_product = my_collection.products[0]
    return redirect(my_product.best_redirect_url, 302)  # 302 is temporary redirect
示例#3
0
def guts(biblio):
    use_cache = False
    my_collection = product.run_collection_from_biblio(use_cache, **biblio)
    my_product = my_collection.products[0]
    return my_product
示例#4
0
文件: views.py 项目: a3nm/oadoi
def get_publication_doi_endpoint(doi):
    request_biblio = {"doi": doi}
    my_collection = product.run_collection_from_biblio(g.use_cache,
                                                       **request_biblio)
    return jsonify({"results": my_collection.to_dict()})