def search(self, doi=None): """Search for given DOI.""" doi = (self.app.config.get("CROSSREF_SEARCH_PREFIX", "") + doi if doi else request.args.get("doi")) from invenio_records.utils import get_unique_record_json # query the database result = get_unique_record_json(doi) if result["status"] == "notfound": # query crossref result = self.get_json(doi) resp = jsonify(result) resp.status_code = response_code.get(result['status'], 200) return resp
def search(self, arxiv=None): """Search for given ArXiv ID.""" arxiv = arxiv or request.args.get("arxiv") from invenio_records.utils import get_unique_record_json # query the database result = get_unique_record_json("\"{0}{1}\"".format( self.app.config.get("ARXIV_SEARCH_PREFIX", ""), arxiv)) if result["status"] == "notfound": # query arxiv result = self.get_json(arxiv) resp = jsonify(result) resp.status_code = response_code.get(result['status'], result['status']) return resp
def search(self, arxiv=None): """Search for given ArXiv ID.""" arxiv = arxiv or request.args.get("arxiv") from invenio_records.utils import get_unique_record_json # query the database result = get_unique_record_json( "\"{0}{1}\"".format(self.app.config.get("ARXIV_SEARCH_PREFIX", ""), arxiv)) if result["status"] == "notfound": # query arxiv result = self.get_json(arxiv) resp = jsonify(result) resp.status_code = response_code.get(result['status'], result['status']) return resp