İPUCU

Java Object Oriented Programming temeline dayanan, çok işlevli, step by step işleyen dilin dökümanlarının paylaşım alanı.

Seçenekler

Arama Motoru-2

30-05-2011 21:46
#1
Virtual Root - ait Kullanıcı Resmi (Avatar)
E-Mail onayı yapılmamış üye
Üyelik tarihi:
06/2008
Mesajlar:
3.490
Teşekkür (Etti):
37
Teşekkür (Aldı):
295
Konular:
2099
Ticaret:
(0) %
Başka bir arama motoru daha. Bu script ile sayfanızda 7 tane arama motorundan faydalanabilirsiniz.

[PHP]


**********

<!-- hide this script from non-JavaScript browsers

// All code in this script is Copyright(C) 1996, Justin Boyan, jab+j@cs.cmu.edu

// For ********ation and more info, see: http://www.cs.cmu.edu/~jab/snark/

// This is SNARK Version 1.0, 18 May 1996

var MAX_ENGINES = 30;

var SNARK_STRING = "hunting+the+snark";

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 YOUR OWN SEARCH ENGINES BELOW. (See http://www.cs.cmu.edu/~jab/snark/ )



Add("Netnews: AltaVista", "",

"http://altavista.digital.com/",

"http://altavista.digital.com/cgi-bin/query?pg=q&what=news&fmt=d&q=hunting+the+snark" );

Add("Shareware/Windows", "",

"http://vsl.cnet.com/",

"http://vsl.cnet.com/cgi-bin/vsl-master/Find?category=MS-Windows%28all%29&search=hunting+the+snark&logop=an d&and=&orfile=++&hits=200" );

Add("Shareware/Unix", "",

"http://vsl.cnet.com/",

"http://vsl.cnet.com/cgi-bin/vsl-master/Find?category=UNIX&search=hunting+the+snark&logop= and&and=&orfile=++&hits=200" );

Add("the Web: AltaVista", "SELECTED",

"http://altavista.digital.com/",

"http://altavista.digital.com/cgi-bin/query?pg=q&what=web&fmt=d&q=hunting+the+snark" );

Add("the Web: Lycos", "",

"http://www.lycos.com/",

"http://twelve.srv.lycos.com/cgi-bin/pursuit?query=hunting+the+snark" );

Add("the Web: Yahoo!", "",

"http://www.yahoo.com/",

"http://search.yahoo.com/bin/search?p=hunting+the+snark" );

Add("Weather (City, ST)", "",

"http://www.nnic.noaa.gov/cgi-bin/page?pg=netcast",

"http://www.nnic.noaa.gov/cgi-bin/netcast.do-it?state=hunting+the+snark&area=Local+Forecast&htm l=yes&match=strong");



// ADD YOUR OWN SEARCH ENGINES ABOVE. (See http://www.cs.cmu.edu/~jab/snark/ )

function HandleForm(form) {

form.submit(); // This fixes a mysterious Netscape bug. Without this line,

// you can't use <enter> to start the search the first time.

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];

********.href = newq ? eng.pre_snark + newq + eng.post_snark : eng.home;

}

function DisplayForm() {

********.writeln('<CENTER><FORM OnSubmit="HandleForm(this); return false">');

********.writeln('Search <SELECT name="service">');

for (i=1; i <= engs.len; i++) {

********.writeln("<OPTION " + engs[i].opts + "> " + engs[i].name);

}

********.writeln('</SELECT> for <INPUT size=26 name="query">');

********.writeln('<input type=submit value=" ARA">');

********.writeln('</FORM> </CENTER>');

}

DisplayForm();

// done hiding from old browsers -->

</script>
[/PHP]




Bookmarks


« Önceki Konu | Sonraki Konu »
Seçenekler

Yetkileriniz
Sizin Yeni Konu Acma Yetkiniz var yok
You may not post replies
Sizin eklenti yükleme yetkiniz yok
You may not edit your posts

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodları Kapalı
Trackbacks are Kapalı
Pingbacks are Kapalı
Refbacks are Kapalı