summaryrefslogtreecommitdiff
path: root/src/usr.bin/nc/scripts/websearch
diff options
context:
space:
mode:
authorericj <>2002-02-19 23:19:39 +0000
committerericj <>2002-02-19 23:19:39 +0000
commit31a22424aa35acd1cf9df9a6c4c3487c347da1c4 (patch)
treecabff89a2fb4291caf9ecdacb0746aafacaf299e /src/usr.bin/nc/scripts/websearch
parenta03c0e851f1aaa82f73eef4a7673768cae02b444 (diff)
downloadopenbsd-31a22424aa35acd1cf9df9a6c4c3487c347da1c4.tar.gz
openbsd-31a22424aa35acd1cf9df9a6c4c3487c347da1c4.tar.bz2
openbsd-31a22424aa35acd1cf9df9a6c4c3487c347da1c4.zip
remove more old cruft
Diffstat (limited to '')
-rw-r--r--src/usr.bin/nc/scripts/websearch79
1 files changed, 0 insertions, 79 deletions
diff --git a/src/usr.bin/nc/scripts/websearch b/src/usr.bin/nc/scripts/websearch
deleted file mode 100644
index 9391c77bde..0000000000
--- a/src/usr.bin/nc/scripts/websearch
+++ /dev/null
@@ -1,79 +0,0 @@
1#! /bin/sh
2# $OpenBSD: websearch,v 1.2 2001/01/29 01:58:13 niklas Exp $
3
4## Hit the major search engines. Hose the [large] output to a file!
5## autoconverts multiple arguments into the right format for given servers --
6## usually worda+wordb, with certain lame exceptions like dejanews.
7## Extracting and post-sorting the URLs is highly recommended...
8##
9## Altavista currently handled by a separate script; may merge at some point.
10##
11## _H* original 950824, updated 951218 and 960209
12
13test "${1}" = "" && echo 'Needs argument[s] to search for!' && exit 1
14PLUSARG="`echo $* | sed 's/ /+/g'`"
15PIPEARG="`echo ${PLUSARG} | sed 's/+/|/g'`"
16IFILE=/tmp/.webq.$$
17
18# Don't have "nc"? Get "netcat" from avian.org and add it to your toolkit.
19doquery () {
20 echo GET "$1" | nc -v -i 1 -w 30 "$2" "$3"
21}
22
23# changed since original: now supplying port numbers and separator lines...
24
25echo "=== Yahoo ==="
26doquery "/bin/search?p=${PLUSARG}&n=300&w=w&s=a" search.yahoo.com 80
27
28echo '' ; echo "=== Webcrawler ==="
29doquery "/cgi-bin/WebQuery?searchText=${PLUSARG}&maxHits=300" webcrawler.com 80
30
31# the infoseek lamers want "registration" before they do a real search, but...
32echo '' ; echo "=== Infoseek ==="
33echo " is broken."
34# doquery "WW/IS/Titles?qt=${PLUSARG}" www2.infoseek.com 80
35# ... which doesn't work cuz their lame server wants the extra newlines, WITH
36# CRLF pairs ferkrissake. Fuck 'em for now, they're hopelessly broken. If
37# you want to play, the basic idea and query formats follow.
38# echo "GET /WW/IS/Titles?qt=${PLUSARG}" > $IFILE
39# echo "" >> $IFILE
40# nc -v -w 30 guide-p.infoseek.com 80 < $IFILE
41
42# this is kinda flakey; might have to do twice??
43echo '' ; echo "=== Opentext ==="
44doquery "/omw/simplesearch?SearchFor=${PLUSARG}&mode=phrase" \
45 search.opentext.com 80
46
47# looks like inktomi will only take hits=100, or defaults back to 30
48# we try to suppress all the stupid rating dots here, too
49echo '' ; echo "=== Inktomi ==="
50doquery "/query/?query=${PLUSARG}&hits=100" ink3.cs.berkeley.edu 1234 | \
51 sed '/^<IMG ALT.*inktomi.*\.gif">$/d'
52
53#djnews lame shit limits hits to 120 and has nonstandard format
54echo '' ; echo "=== Dejanews ==="
55doquery "/cgi-bin/nph-dnquery?query=${PIPEARG}+maxhits=110+format=terse+defaultOp=AND" \
56 smithers.dejanews.com 80
57
58# OLD lycos: used to work until they fucking BROKE it...
59# doquery "/cgi-bin/pursuit?query=${PLUSARG}&maxhits=300&terse=1" \
60# query5.lycos.cs.cmu.edu 80
61# NEW lycos: wants the User-agent field present in query or it returns nothing
62# 960206: webmaster@lycos duly bitched at
63# 960208: reply received; here's how we will now handle it:
64echo \
65"GET /cgi-bin/pursuit?query=${PLUSARG}&maxhits=300&terse=terse&matchmode=and&minscore=.5 HTTP/1.x" \
66 > $IFILE
67echo "User-agent: *FUCK OFF*" >> $IFILE
68echo "Why: go ask todd@pointcom.com (Todd Whitney)" >> $IFILE
69echo '' >> $IFILE
70echo '' ; echo "=== Lycos ==="
71nc -v -i 1 -w 30 twelve.srv.lycos.com 80 < $IFILE
72
73rm -f $IFILE
74exit 0
75
76# CURRENTLY BROKEN [?]
77# infoseek
78
79# some args need to be redone to ensure whatever "and" mode applies