Index: /other-projects/ir-harvest/trunk/oai-download/COMPILE.sh
===================================================================
--- /other-projects/ir-harvest/trunk/oai-download/COMPILE.sh	(revision 31698)
+++ /other-projects/ir-harvest/trunk/oai-download/COMPILE.sh	(revision 31698)
@@ -0,0 +1,1 @@
+javac -cp .\;sax2r2.jar org/waikato/harvest/OAIBase2IdList.java
Index: /other-projects/ir-harvest/trunk/oai-download/RUN.sh
===================================================================
--- /other-projects/ir-harvest/trunk/oai-download/RUN.sh	(revision 31698)
+++ /other-projects/ir-harvest/trunk/oai-download/RUN.sh	(revision 31698)
@@ -0,0 +1,1 @@
+java -cp .\;sax2r2.jar org.waikato.harvest.OAIBase2IdList
Index: /other-projects/ir-harvest/trunk/oai-download/org/waikato/harvest/OAIBase2IdList.java
===================================================================
--- /other-projects/ir-harvest/trunk/oai-download/org/waikato/harvest/OAIBase2IdList.java	(revision 31698)
+++ /other-projects/ir-harvest/trunk/oai-download/org/waikato/harvest/OAIBase2IdList.java	(revision 31698)
@@ -0,0 +1,105 @@
+package org.waikato.harvest;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.waikato.harvest.OAIListSAXHandler;
+
+public class OAIBase2IdList
+{
+
+    public static InputSource GetOAIListPage(String list_url, String list_args)
+    {
+	InputSource isource = null;
+	
+	try {
+	    HttpURLConnection httpcon = (HttpURLConnection) ((new URL(list_url).openConnection()));
+	    httpcon.setDoOutput(true);
+	    //httpcon.setRequestProperty("Content-Type", "application/json");
+	    //httpcon.setRequestProperty("Accept", "application/json");
+	    httpcon.setRequestMethod("GET");
+	    httpcon.connect();
+	    
+	    byte[] outputBytes = list_args.getBytes("UTF-8");
+	    OutputStream os = httpcon.getOutputStream();
+	    os.write(outputBytes);
+	    os.close();
+	    
+	    // Read response
+	    InputStream istream = httpcon.getInputStream();
+	    Reader isreader = new InputStreamReader(istream,"UTF-8");
+	    BufferedReader breader = new BufferedReader(isreader);
+	    isource = new InputSource(breader);
+	    isource.setEncoding("UTF-8");
+
+	    
+	}
+	catch (Exception e) {
+	    e.printStackTrace();
+	}
+
+	return isource;
+    }
+    
+    public static void main( String[] args )
+    {
+	
+	String[] oai_base_urls = new String[]
+	{
+	    "http://nrl.northumbria.ac.uk/cgi/oai2",
+	    "http://discovery.ucl.ac.uk/cgi/oai2",
+	    "http://etheses.whiterose.ac.uk/cgi/oai2",
+	    "http://theses.gla.ac.uk/cgi/oai2"
+	};
+
+	for (String oai_base_url: oai_base_urls) {
+	    try {
+		System.out.println("base url = " + oai_base_url);
+		InputSource is = GetOAIListPage(oai_base_url, "verb=ListIdentifiers&metadataPrefix=oai_dc");
+			
+		SAXParserFactory factory = SAXParserFactory.newInstance();
+		SAXParser saxParser = factory.newSAXParser();
+		
+		OAIListSAXHandler handler = new OAIListSAXHandler();
+				
+		saxParser.parse(is, handler);
+		//is.close();
+		
+		handler.printIdentifiers();
+		String resumptionToken = handler.getResumptionToken();
+		
+		
+	    }
+	    catch (Exception e) {
+		e.printStackTrace();
+	    }
+
+	}
+
+    }
+}
Index: /other-projects/ir-harvest/trunk/oai-download/org/waikato/harvest/OAIListSAXHandler.java
===================================================================
--- /other-projects/ir-harvest/trunk/oai-download/org/waikato/harvest/OAIListSAXHandler.java	(revision 31698)
+++ /other-projects/ir-harvest/trunk/oai-download/org/waikato/harvest/OAIListSAXHandler.java	(revision 31698)
@@ -0,0 +1,87 @@
+package org.waikato.harvest;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.ArrayList;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+
+public class OAIListSAXHandler extends DefaultHandler
+{
+    boolean identifier_tag_open_ = false;
+    String  identifier_text_     = null;
+    
+    boolean resumptionToken_tag_open_ = false;
+    String  resumptionToken_text_     = null;
+
+    ArrayList<String> identifiers_;
+
+    public OAIListSAXHandler()
+    {
+	identifiers_ = new ArrayList<String>();
+    }
+    
+    public void startElement(String uri, String localName,
+			     String qName, Attributes attributes) throws SAXException
+    {		
+	if (qName.equalsIgnoreCase("identifier")) {
+	    identifier_tag_open_ = true;
+	}
+	else if (qName.equalsIgnoreCase("resumptionToken")) {
+	    resumptionToken_tag_open_ = true;
+	}
+    }
+	
+    public void characters(char ch[], int start, int length) throws SAXException
+    {
+	if (identifier_tag_open_) {
+	    identifier_text_ = new String(ch, start, length);
+	}
+	else if (resumptionToken_tag_open_) {
+	    resumptionToken_text_ = new String(ch, start, length);
+	}
+	
+    }
+	
+    public void endElement(String uri, String localName, String qName) throws SAXException
+    {
+	if (qName.equalsIgnoreCase("identifier")) {
+	    identifiers_.add(identifier_text_);
+	    identifier_text_ = null;
+	    identifier_tag_open_ = false;
+	}
+	else if (qName.equalsIgnoreCase("resumptionToken")) {
+	    resumptionToken_tag_open_ = false;
+	}
+	
+    }
+
+    public void printIdentifiers()
+    {
+	for (String id: identifiers_) {
+	    System.out.println("id: " + id);
+	}
+
+	System.out.println("Resumption token: " + resumptionToken_text_);
+    }
+
+    public ArrayList<String> getIdentifiers()
+    {
+	return identifiers_;
+    }
+
+    public String getResumptionToken()
+    {
+	return resumptionToken_text_;
+    }
+}
+
