<h4>Search the Internet</h4>
<p>
<script><!-- Copyright 1995-2001 - Peter Tilbrook ([EMAIL PROTECTED])
var MAX_ENGINES = 30;
var SNARK_STRING = "friends+plus";
function MakeArray(n) {
for (var i = 1; i <= n; i++) {
this[i] = 0;
}
this.maxlen = n;
this.len = 0;
return this;
}
var engs = new MakeArray(MAX_ENGINES);
function find_substring(needle, haystack) {
var i, needlen = needle.length, haylen = haystack.length;
for (i=0; i<=haylen-needlen; i++) {
if (needle == haystack.substring(i,i+needlen))
return i;
}
return false;
}
function Engine(name, opts, home, search) {
var snark = find_substring(SNARK_STRING, search);
this.name = name;
this.opts = opts;
this.home = home;
this.pre_snark = search.substring(0,snark);
this.post_snark= search.substring(snark+SNARK_STRING.length, search.length);
}
function Add(name, opts, home, search) {
engs.len++;
if (engs.len <= engs.maxlen) {
engs[engs.len] = new Engine(name, opts, home, search)
}
else {
alert("Better increase MAX_ENGINES: " + engs.len + ">" + engs.maxlen)
}
}
Add("AltaVista","","http://au.altavista.com/","http://search.au.altavista.com/cgi-bin/query?aveenc=1&pg=q&sc=on&q=friends+plus&kl=en&what=pg.au&search.x=29&search.y=7"
);
Add("Anzwers","","http://www.anzwers.com.au/","http://www.anzwers.com.au/cgi-bin/process_search.pl?pageid=search&firstresult=0&query=friends+plus&location=Australia&query_type=all+the+words&numperpage=10&result_type=detailed&search.x=17&search.y=7"
);
Add("Ask
Jeeves","","http://www.askjeeves.com/","http://www.anzwers.com.au/cgi-bin/process_search.pl?pageid=search&firstresult=0&query=friends+plus&location=Australia&query_type=all+the+words&numperpage=10&result_type=detailed&search.x=17&search.y=7"
);
Add("Beaucoup!","","http://www.beaucoup.com/","http://partners.mamma.com/Beaucoup?lang=1&timeout=4&rpp=10&cb=Beaucoup&query=friends+plus&qtype=0"
);
Add("Google","","http://www.google.com/","http://www.google.com/search?q=friends+plus&btnG=Google+Search"
);
Add("Google
Newsgroups","","http://groups.google.com/","http://groups.google.com/groups?oi=djq&as_q=friends+plus"
);
Add("Excite","","http://www.excite.com","http://www.excite.com/search.gw?search=friends+plus"
);
Add("Hotbot","","http://www.hotbot.com","http://www.search.hotbot.com/IU0ysAaP526F58ABE94F5F9C6FA51559CF872482/hResult.html?SM=MC&MT=friends+plus&DV=7&RG=.com&DC=10&DE=2&search.x=36&search.y=10
)" );
Add("Looksmart","","http://www.looksmart.com.au/","http://www.looksmart.com.au/r?look=&search=&isp=OZ&key=friends+plus&search=us695660%3Bus302562"
);
Add("Lycos",
"","http://www.lycos.com/","http://www.lycos.com/cgi-bin/pursuit?query=friends+plus" );
Add("Magellan","","http://magellan.excite.com/","http://search.excite.com/search.gw?search=friends+plus&c=web&look=magellan"
);
Add("Mamma","","http://www.mamma.com/","http://www.mamma.com/cgi-bin/parsearch2?qtype=0&lang=1&query=friends+plus&summaries=on"
);
Add("Metacrawler","","http://www.metacrawler.com/","http://www.metacrawler.com/crawler?general=friends+plus&target=&method=0®ion=0&rpp=20&timeout=10&hpe=10"
);
Add("Microsoft","","http://www.microsoft.com","http://search.microsoft.com/us/SearchMS25.asp?qu=friends+plus&so=RECCNT&boolean=ALL&intCat=0&intCat=1&intCat=2&intCat=3&intCat=4&intCat=5&intCat=6&intCat=7&intCat=8&intCat=9&nq=NEW&p=1"
);
Add("NBCi","","http://home.nbci.com/dir/0,668,home-0,00.html?st.sn.ip.t.srh/","http://home.nbci.com/search/directory/results/1,61,home-0,00.html?keyword=friends+plus"
);
Add("Northern
Light","","http://www.northernlight.com/","http://www.northernlight.com/nlquery.fcg?cb=0&qr=friends+plus"
);
Add("SimpleSearch.com","","http://www.simplesearch.com/","http://www.simplesearch.com/cgi-bin/simpsrch?search=friends+plus"
);
Add("WebCrawler","","http://www.webcrawler.com/","http://www.webcrawler.com/cgi-bin/WebQuery?searchText=friends+plus"
);
Add("Web
Wombat","","http://www.webwombat.com/","http://www.webwombat.com/wombat?I=friends+plus&Search.x=29&Search.y=10"
);
Add("WebSearch
Australia","","http://www.websearch.com.au/","http://search.websearch.com.au/cgi-bin/websearch?method=and&sort=score&config=australia&restrict=&exclude=&format=builtin-long&words=friends+plus");
Add("Yahoo!","","http://www.yahoo.com/","http://search.yahoo.com/bin/search?p=friends+plus"
);
function HandleForm(form) {
form.submit();
var i, oldq=form.query.value, newq="";
for (i=0; i<oldq.length; i++) { // compress [ ]+ into \+
var thischar = oldq.charAt(i);
if (thischar != ' ')
newq += thischar;
else if (lastchar != ' ')
newq += '+';
lastchar = thischar;
}
var eng = engs[1+form.service.selectedIndex];
location.href = newq ? eng.pre_snark + newq + eng.post_snark : eng.home;
}
function DisplayForm() {
document.writeln('<FORM OnSubmit="HandleForm(this); return false">');
document.writeln('Search <SELECT name="service">');
for (i=1; i <= engs.len; i++) {
document.writeln("<OPTION " + engs[i].opts + "> " + engs[i].name);
}
document.writeln('</SELECT> for <INPUT size=20 name="query">');
document.writeln('<input type=submit value="Search!">');
document.writeln('</FORM>');
}
DisplayForm();
// done hiding from old browsers -->
</script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists