summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authororbiter <mc@yacy.net>2012-12-10 21:01:14 +0100
committerorbiter <mc@yacy.net>2012-12-10 21:01:14 +0100
commitf86d469973fb25f0dddc8faae5ea7672a3a1dbe3 (patch)
tree7f9879924b282801ccb0fdb655f207157576f9b0 /bin
parent54e193a2b8cb319d34339e8441670e4b6b0131e7 (diff)
more search command tools
Diffstat (limited to 'bin')
-rwxr-xr-xbin/search.sh4
-rwxr-xr-xbin/search1.sh33
-rwxr-xr-xbin/searchall.sh4
-rwxr-xr-xbin/searchall1.sh4
-rwxr-xr-xbin/up.sh8
-rwxr-xr-xbin/up1.sh10
6 files changed, 56 insertions, 7 deletions
diff --git a/bin/search.sh b/bin/search.sh
new file mode 100755
index 000000000..aa74583a2
--- /dev/null
+++ b/bin/search.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+cd "`dirname $0`"
+port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
+./search1.sh -s localhost:$port '"$1"' \ No newline at end of file
diff --git a/bin/search1.sh b/bin/search1.sh
new file mode 100755
index 000000000..c66ba5ed3
--- /dev/null
+++ b/bin/search1.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+cd "`dirname $0`"
+if which curl &>/dev/null; then
+ while getopts "ys" opt; do
+ case $opt in
+ y)
+ shift;
+ curl -s "http://$1/yacysearch.rss?query=$2" | awk '/^<link>/{ gsub("<link>","" );gsub("<\/link>","" ); print $0 }'
+ ;;
+ s)
+ shift;
+ curl -s "http://$1/solr/select?q=text_t:$2&start=0&rows=100&fl=sku&wt=rss" | awk '/^<link>/{ gsub("<link>","" );gsub("<\/link>","" ); print $0 }'
+ ;;
+ esac
+ done
+elif which wget &>/dev/null; then
+ while getopts "ys" opt; do
+ case $opt in
+ y)
+ shift;
+ wget -q -O - "http://$1/yacysearch.rss?query=$2" | awk '/^<link>/{ gsub("<link>","" );gsub("<\/link>","" ); print $0 }'
+ ;;
+ s)
+ shift;
+ wget -q -O - "http://$1/solr/select?q=text_t:$2&start=0&rows=100&fl=sku&wt=rss" | awk '/^<link>/{ gsub("<link>","" );gsub("<\/link>","" ); print $0 }'
+ ;;
+ esac
+ done
+else
+ echo "Neither curl nor wget installed!"
+ exit 1
+fi
+
diff --git a/bin/searchall.sh b/bin/searchall.sh
new file mode 100755
index 000000000..39ef07c3c
--- /dev/null
+++ b/bin/searchall.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+cd "`dirname $0`"
+port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
+./searchall1.sh -s localhost:$port $1 \ No newline at end of file
diff --git a/bin/searchall1.sh b/bin/searchall1.sh
new file mode 100755
index 000000000..807d782d6
--- /dev/null
+++ b/bin/searchall1.sh
@@ -0,0 +1,4 @@
+TMPFILE=`mktemp -t search` || exit 1
+for address in `./up1.sh $1`; do sleep 0.01; ./search1.sh -s $address $2 >> $TMPFILE & done
+sleep 2
+cat $TMPFILE \ No newline at end of file
diff --git a/bin/up.sh b/bin/up.sh
index 57ade3959..2a57b6eb6 100755
--- a/bin/up.sh
+++ b/bin/up.sh
@@ -1,11 +1,5 @@
#!/bin/bash
cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
-if which curl &>/dev/null; then
- curl -s "http://localhost:$port/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}';
-elif which wget &>/dev/null; then
- wget -q -O - "http://localhost:$port/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}';
-else
- exit 1
-fi
+./up1.sh localhost:$port
diff --git a/bin/up1.sh b/bin/up1.sh
new file mode 100755
index 000000000..17d88cc39
--- /dev/null
+++ b/bin/up1.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+cd "`dirname $0`"
+if which curl &>/dev/null; then
+ curl -s "http://$1/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}';
+elif which wget &>/dev/null; then
+ wget -q -O - "http://$1/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}';
+else
+ exit 1
+fi
+