#!/bin/sh
# A quick hack to compare queries for various publishing registries.

args="from=2008-03-01&until=2008-03-15"

function count() {
	oaiEndpoint=$1
	oaiURL="$oaiEndpoint?verb=ListIdentifiers&metadataPrefix=ivo_vor&$args"
	wget -qO - "$oaiURL" |\
	xmlstarlet sel -N oai=http://www.openarchives.org/OAI/2.0/ -t \
		-v "count(//oai:identifier)"
}

echo -n "EuroVO "
count http://registry.euro-vo.org/oai.jsp

echo -n "STScI "
count http://nvo.stsci.edu/vor10/oai.aspx
