You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
952 B
34 lines
952 B
#!/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
|
|
|