Index: /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/README.txt
===================================================================
--- /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/README.txt	(revision 36332)
+++ /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/README.txt	(revision 36332)
@@ -0,0 +1,3 @@
+
+
+pip install requests
Index: /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/crossref-get-doi.py
===================================================================
--- /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/crossref-get-doi.py	(revision 36332)
+++ /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/crossref-get-doi.py	(revision 36332)
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+
+# Currently only tested with Python3
+from __future__ import print_function
+
+
+# For more info on the CrossRef API, see:
+#   https://www.crossref.org/documentation/retrieve-metadata/rest-api/a-non-technical-introduction-to-our-api/
+#
+# The default DOI value used below is based on the one given in the CrossRef documentation
+
+import os
+import sys
+import json
+
+import argparse
+
+import requests
+import urllib.parse
+
+import util
+
+base_url = "https://api.crossref.org"
+search_work_url = base_url+"/works/"
+
+
+# JSON is returned by default by CrossRef, but let's be explicit!
+headers = {
+    'Content-type': 'application/json'
+}
+
+
+def getDOI(doi):
+    
+    query_url  = search_work_url + urllib.parse.quote_plus(doi)
+
+    print("query_url="+query_url)
+
+    # Based on:
+    #    https://stackoverflow.com/questions/25491090/how-to-use-python-to-execute-a-curl-command    
+    response = requests.get(query_url, headers=headers)
+
+    returned_json_str = response.content
+    returned_json     = json.loads(returned_json_str)
+
+    return returned_json
+
+
+        
+if __name__ == "__main__":
+
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument('doi', nargs='?')
+    parser.add_argument('output-file.json', nargs='?')
+    
+    args = parser.parse_args()
+    
+    doi = getattr(args,'doi');
+    if (doi == None):
+        # CrossRef Example
+        crossref_example_doi = "10.1155/2014/413629"
+                
+        # Bainbridge et al example, IJDL user-centric approach ...
+        stinky_doi = "10.1145/1998076.1998084"
+    
+        print("As a default, selecting CrossRef example DOI: " + crossref_example_doi)
+        doi = crossref_example_doi
+
+    json_output_filename = getattr(args,'output-file.json');
+    if (json_output_filename == None):
+        encoded_doi = urllib.parse.quote_plus(doi)        
+        json_output_filename = "crossref-"+encoded_doi+".json"
+    
+    returned_json = getDOI(doi)
+
+    util.writeJSON(json_output_filename,returned_json)
+
Index: /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/oacore-get-doi.py
===================================================================
--- /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/oacore-get-doi.py	(revision 36332)
+++ /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/oacore-get-doi.py	(revision 36332)
@@ -0,0 +1,111 @@
+#!/usr/bin/env python
+
+# Currently only tested with Python3
+from __future__ import print_function
+
+# For more info on the Core V3 API, see:
+#   https://api.core.ac.uk/docs/v3
+#
+# The default DOI value used below is based on the one given in the Core V3 API documentation
+
+
+import os
+import sys
+import json
+
+import argparse
+
+import requests
+import urllib.parse
+
+import util
+
+
+apiKey = util.readKey("oacore-key.txt")
+
+
+base_url = "https://api.core.ac.uk/v3"
+
+search_work_url = base_url+"/search/works/"
+discover_url    = base_url+"/discover"
+
+headers = {
+    'Content-type': 'application/json'
+}
+
+
+def getDOI(doi):
+    
+    query_args = "api_key="+apiKey+"&q="+urllib.parse.quote_plus("doi:\""+doi+"\"")
+    query_url  = search_work_url + "?" + query_args
+
+    # print("query_url="+query_url)
+
+    # Based on:
+    #    https://stackoverflow.com/questions/25491090/how-to-use-python-to-execute-a-curl-command
+    
+    response = requests.get(query_url, headers=headers)
+
+    
+    #data = '{}'
+    # More work to be done to see if the following can be made to work
+    #data = {
+    #    "api_key": apiKey,
+    #    "q":       "doi:\""+doi+"\""
+    #}
+    #response = requests.get(query_url, headers=headers, data=data)
+
+
+    returned_json_str = response.content
+    
+    returned_json = json.loads(returned_json_str)
+
+    return returned_json
+
+
+        
+if __name__ == "__main__":
+
+    parser = argparse.ArgumentParser()
+    #parser.add_argument('--sheetname', help="The name of the sheet within the Excel file to extractc data from")
+    #parser.add_argument('--votingtype', choices=["J","T", "JT"], help="Filter to only J=Jury, T=Tele cast votes, JT=Combined jury and tele votes")
+    parser.add_argument('doi', nargs='?')
+    parser.add_argument('output-file.json', nargs='?')
+    
+    args = parser.parse_args()
+
+    #sheetname = getattr(args,'sheetname');
+    #voting_type = getattr(args,'votingtype');
+    
+    doi = getattr(args,'doi');
+    if (doi == None):        
+        oacore_example_doi="10.1016/0370-2693(96)00910-0"
+    
+        # Bainbridge et al example, IJDL user-centric approach ...
+        stinky_doi="10.1145/1998076.1998084"
+    
+        print("As a default, selecting Core example DOI: " + oacore_example_doi)
+        doi = oacore_example_doi
+
+    json_output_filename = getattr(args,'output-file.json');
+    if (json_output_filename == None):
+        encoded_doi = urllib.parse.quote_plus(doi)        
+        json_output_filename = "oacore-"+encoded_doi+".json"
+    
+    returned_json = getDOI(doi)
+    returned_json_prettyprint = json.dumps(returned_json, indent=2, ensure_ascii=False)
+
+    print("Saving returned JSON output to: " + json_output_filename)
+
+    with open(json_output_filename, 'w', encoding="utf8") as fout:
+        fout.write(returned_json_prettyprint)
+
+    
+# Or consider using their Python API:
+#
+#    https://github.com/oacore/pyoacore
+
+# They also support Java, R and (it looks like) NodeJS
+
+
+# https://core.ac.uk/search?q=doi%3A%2210.1186%2F1471-2458-6-309%22&page=1
Index: /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/oacore-key.txt.in
===================================================================
--- /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/oacore-key.txt.in	(revision 36332)
+++ /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/oacore-key.txt.in	(revision 36332)
@@ -0,0 +1,10 @@
+# Copy to 'oacore-key.txt' and fill in with your allocated key
+#
+# To get a key, first register through
+#   https://core.ac.uk/services/api
+#
+# Confirm sign up through email
+# Then request a key
+#
+# which again is delivered to you through email
+<YOUR-KEY>
Index: /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/util.py
===================================================================
--- /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/util.py	(revision 36332)
+++ /other-projects/bib-stinky/trunk/nodejs-server/doi-stinky/util.py	(revision 36332)
@@ -0,0 +1,39 @@
+from __future__ import print_function
+
+import json
+import re
+import sys
+
+def eprint(*args, **kwargs):
+    print(*args, file=sys.stderr, **kwargs)
+
+
+def readKey(filename):
+
+    try:
+        # read with auto-close
+        with open(filename,"r") as fin:
+            lines = fin.readlines()
+
+    except FileNotFoundError as e:
+        eprint("Failed to find '"+filename+"'")
+        eprint("Have you created your own version of this file based on " + filename + ".in ?")
+        return ""
+                
+    key = ""
+    for line in lines:
+        if not re.match(r'^(#.*)|(\s*)$',line):
+            line_stripped = line.strip().rstrip();
+            key = key + line_stripped
+
+    return key
+
+def writeJSON(json_output_filename,returned_json):
+
+    returned_json_prettyprint = json.dumps(returned_json, indent=2, ensure_ascii=False)
+
+    print("Saving returned JSON output to: " + json_output_filename)
+
+    # write output with auto-close file handle
+    with open(json_output_filename, 'w', encoding="utf8") as fout:
+        fout.write(returned_json_prettyprint)
