Changeset 36331 for other-projects
- Timestamp:
- 2022-07-28T23:48:34+12:00 (21 months ago)
- Location:
- other-projects/bib-stinky/trunk/doi-stinky
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/bib-stinky/trunk/doi-stinky/oacore-get-doi.py
r36326 r36331 5 5 6 6 # For more info on the Core V3 API, see: 7 # 7 # https://api.core.ac.uk/docs/v3 8 8 # 9 # The default DOI value used is based on the one given in the Core V3 API documentation9 # The default DOI value used below is based on the one given in the Core V3 API documentation 10 10 11 11 … … 25 25 26 26 27 # Based on:28 # https://stackoverflow.com/questions/25491090/how-to-use-python-to-execute-a-curl-command29 30 27 base_url = "https://api.core.ac.uk/v3" 31 28 … … 43 40 query_url = search_work_url + "?" + query_args 44 41 42 # print("query_url="+query_url) 45 43 46 print("query_url="+query_url) 47 44 # Based on: 45 # https://stackoverflow.com/questions/25491090/how-to-use-python-to-execute-a-curl-command 46 48 47 response = requests.get(query_url, headers=headers) 49 48 50 49 51 50 #data = '{}' 52 51 # More work to be done to see if the following can be made to work -
other-projects/bib-stinky/trunk/doi-stinky/util.py
r36323 r36331 1 1 from __future__ import print_function 2 2 3 import json 3 4 import re 4 5 import sys … … 27 28 28 29 return key 30 31 def writeJSON(json_output_filename,returned_json): 32 33 returned_json_prettyprint = json.dumps(returned_json, indent=2, ensure_ascii=False) 34 35 print("Saving returned JSON output to: " + json_output_filename) 36 37 # write output with auto-close file handle 38 with open(json_output_filename, 'w', encoding="utf8") as fout: 39 fout.write(returned_json_prettyprint)
Note:
See TracChangeset
for help on using the changeset viewer.