Happy new year
[pazpar2-moved-to-github.git] / perf / bash / client.sh
index 06aa523..ecf2e6f 100755 (executable)
@@ -3,9 +3,23 @@ OF=$1
 if test -z "$OF"; then
        OF=1
 fi
-H='http://localhost:9004/search.pz2'
-wget -q -O $OF.init.xml "$H/?command=init&service=perf&extra=$OF"
+
+PORT=$2
+if test -z "$PORT"; then
+       PORT=9004
+fi
+SERVICE=$3
+if test -z "$SERVICE"; then
+       SERVICE=perf
+fi
+SETTINGS=$4
+WHAT=water
+H="http://localhost:${PORT}/search.pz2"
+wget -q -O $OF.init.xml "$H/?command=init&service=${SERVICE}&extra=$OF"
 S=`xsltproc get_session.xsl $OF.init.xml`
-wget -q -O $OF.search.xml "$H?command=search&query=100&session=$S"
-sleep 0.5
-wget -q -O $OF.show.xml "$H?command=show&session=$S"
+if [ "$SETTINGS" != "" ] ; then
+    wget -q -O $OF.settings.xml "$H?command=settings&session=$S&$SETTINGS"
+fi
+wget -q -O $OF.search.xml "$H?command=search&query=$WHAT&session=$S"
+sleep 1
+wget -q -O $OF.show.xml "$H?command=show&session=$S&sort=relevance&start=0&num=100&block=1"