Skip to content

Commit

Permalink
fixing issue in the code syntax and looping strategy with the help
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazztok45 committed Nov 11, 2024
1 parent 10647fc commit 12ab7cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/zbmath_rest2oai/getAsXml.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ def final_xml2(api_source, prefix):
soft_id=api_source.split("/")[-1]
list_articles_ids_to_soft=[]
def api_doc_endpoint(page):
return requests.get("https://api.zbmath.org/v1/document/_structured_search?page={}&results_per_page=100&software%20id=".format(page)+soft_id)
return requests.get("https://api.zbmath.org/v1/document/_structured_search?page={}&results_per_page=100&software%20id=".format(page,soft_id))
page=0
while api_doc_endpoint["result"]!=None:
while True:
data = api_doc_endpoint(page)
if data is None or "result" not in data or not data["result"]:
break
list_articles_ids_to_soft.extend([entry["id"] for entry in data["result"]])
page+=1
for result in json["result"]:
Expand Down

0 comments on commit 12ab7cf

Please sign in to comment.