added new shell script to do a web search from the terminal

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4916 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 48edbef5c7
commit 994c609cf8

@ -0,0 +1 @@
curl -s "http://localhost:8080/yacysearch.rss?query=$1&resource=local&verify=false" | grep link | grep -v opensearchdescription | grep -v yacysearch | grep -v 'yacy:item' | sed 's/<link>//' | sed 's/<\/link>//'

@ -1,9 +1,11 @@
#!/bin/sh
cd "`dirname $0`"
S=`date "+%s"`
C=0
for N in `cat searchtest.words`; do
curl -s "http://localhost:8080/yacysearch.rss?query=$N&resource=local&verify=false" | grep link
C=$(($C+1))
echo search for $N:
./localsearch.sh $N
C=$(($C+1))
done
T=`date "+%s"`
echo runtime = $(($T-$S)) seconds, count = $C, time per query = $((1000*($T-$S)/$C)) milliseconds

@ -116,6 +116,7 @@ public class yacysearch {
prop.put("input_constraint", "");
prop.put("input_cat", "href");
prop.put("input_depth", "0");
prop.put("input_verify", "true");
prop.put("input_contentdom", "text");
prop.put("input_contentdomCheckText", "1");
prop.put("input_contentdomCheckAudio", "0");
@ -417,6 +418,7 @@ public class yacysearch {
prop.putHTML("input_prefermaskfilter", prefermask);
prop.put("input_indexof", (indexof) ? "on" : "off");
prop.put("input_constraint", (constraint == null) ? "" : constraint.exportB64());
prop.put("input_verify", (fetchSnippets) ? "true" : "false");
prop.put("input_contentdom", (post == null ? "text" : post.get("contentdom", "text")));
prop.put("input_contentdomCheckText", (contentdomCode == plasmaSearchQuery.CONTENTDOM_TEXT) ? "1" : "0");
prop.put("input_contentdomCheckAudio", (contentdomCode == plasmaSearchQuery.CONTENTDOM_AUDIO) ? "1" : "0");

@ -8,11 +8,11 @@
<channel>
<title>YaCy P2P-Search for #[rss_query]#</title>
<description>Search for #[rss_query]#</description>
<link>#[searchBaseURL]#?search=#[rss_queryenc]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#</link>
<link>#[searchBaseURL]#?query=#[rss_queryenc]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#&amp;verify=#[input_verify]#</link>
<image>
<url>#[rssYacyImageURL]#</url>
<title>Search for #[rss_query]#</title>
<link>#[searchBaseURL]#?search=#[rss_queryenc]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#</link>
<link>#[searchBaseURL]#?query=#[rss_queryenc]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#&amp;verify=#[input_verify]#</link>
</image>
<opensearch:totalResults>#[num-results_totalcount]#</opensearch:totalResults>
<opensearch:startIndex>#[num-results_offset]#</opensearch:startIndex>

Loading…
Cancel
Save