By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Looking for multiple Googler script

P: n/a
G'day

I'm looking for a script that can search multiple instances of Google
(or other search engines optionally). The user types in a single word
in the text field, presses ENTER or the submit button, and the browser
launches several instances of Google with the single word + other
search terms.

I would like to have this script because I'm a translator and
frequently need to look up the meaning of words. I Google using
combinations like searchterm+glossary, searchterm+terms,
searchterm+glossary+site:.countrycode (for country specific usage)
etc.

The way I see it, basically the script should take the user's word and
concatenate it with the prefix "http://www.google.com/search?q=" and
the suffix "+glossary&num=100", and then launch a window with that
URL. I managed to adapt a simple password URL script to do this, but
it only launches one instance of Google. I'd like to launch several
windows each with a different combination.

Searches for phrases can take the prefix
"http://www.google.com/search?q=%22" and the suffix
"%22+glossary&num=100", on a seperate section of the page meant for
phrase searches.

It would be nice if the script can automatically determine in the case
of single words that the words entered by the user needs to be
concatenated with "+" inbetween, but this is entirely optional. An
alternative method to allow the user to search more than one word is
to simply have a form with a number of text boxes. Since Google
ignores extra plusses in the search URL (a search for
searchterm+searchterm will yield the same result as
searchterm+++++searchterm or searchterm+++searchterm++), it won't
break the script if some of the boxes are left empty.

Does such a script exist, or if not, can anyone please write me one?

Thanks in advance.
Voetleuce
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Lee
Voetleuce en f?nsievry said:

G'day

I'm looking for a script that can search multiple instances of Google


<html>
<head>
<script type="text/javascript">
function go(f){
var count=0;
var prefix="http://www.google.com/search?q="+f.q.value.replace(/\s+/g,"+");
for(var i=0;i<f.opt.length;i++){
if(f.opt[i].checked){
var search=prefix+"+"+f.opt[i].value;
if(f.opt[i].value=="site:"){
search+=f.site.value;
}
count++;
window.open(search,
("window"+Math.random()).replace(/\./,""),
"top="+(50*count)+",left="+(50*count)
);
}
}
if(!count){ // nothing checked
window.open(prefix,("window"+Math.random()).replac e(/\./,""));
}
}
</script>
</head>
<body>
<form>
<table>
<tr>
<td align="right">
Search for:&nbsp;
</td>
<td>
<input name="q">
<input type="button" value="Go" onclick="go(this.form)">
</td>
</tr>
<tr>
<td align="right">
With:&nbsp;
</td>
<td>
<input type="checkbox" name="opt" value="terms">terms
<input type="checkbox" name="opt" value="glossary">glossary
<input type="checkbox" name="opt" value="site:">site:<input name="site">
</td>
</tr>
</table>
</form>
</body>
</html>

Jul 20 '05 #2

P: n/a
Lee <RE**************@cox.net> wrote in message news:<br********@drn.newsguy.com>...
Voetleuce en f?nsievry said:
G'day

I'm looking for a script that can search multiple instances of Google

<html>
<head>
<script type="text/javascript">
function go(f){
var count=0;
var prefix="http://www.google.com/search?q="+f.q.value.replace(/\s+/g,"+");
for(var i=0;i<f.opt.length;i++){
if(f.opt[i].checked){
var search=prefix+"+"+f.opt[i].value;
if(f.opt[i].value=="site:"){
search+=f.site.value;
}
count++;
window.open(search,
("window"+Math.random()).replace(/\./,""),
"top="+(50*count)+",left="+(50*count)
);
}
}
if(!count){ // nothing checked
window.open(prefix,("window"+Math.random()).replac e(/\./,""));
}
}
</script>
</head>
<body>
<form>
<table>
<tr>
<td align="right">
Search for:&nbsp;
</td>
<td>
<input name="q">
<input type="button" value="Go" onclick="go(this.form)">
</td>
</tr>
<tr>
<td align="right">
With:&nbsp;
</td>
<td>
<input type="checkbox" name="opt" value="terms">terms
<input type="checkbox" name="opt" value="glossary">glossary
<input type="checkbox" name="opt" value="site:">site:<input name="site">
</td>
</tr>
</table>
</form>
</body>
</html>


Thanks a lot! This does exactly what I needed. I have one question,
though, if you don't mind: I'd like the windows to open full screen
with scrollbars (with or without address field, that's optional). I
managed to get full screen by changing

window.open(search,
("window"+Math.random()).replace(/\./,""),
"top="+(50*count)+",left="+(50*count)
);

to

window.open(search);

but I could not figure out how to enable the scroll bars. The only
scripts or information I could find on the web deal with *removing*
them, heh-heh.

Thanks again.
Jul 20 '05 #3

P: n/a
Lee
Voetleuce en f?nsievry said:
Thanks a lot! This does exactly what I needed. I have one question,
though, if you don't mind: I'd like the windows to open full screen
with scrollbars (with or without address field, that's optional). I
managed to get full screen by changing

window.open(search,
("window"+Math.random()).replace(/\./,""),
"top="+(50*count)+",left="+(50*count)
);

to

window.open(search);

but I could not figure out how to enable the scroll bars. The only
scripts or information I could find on the web deal with *removing*
them, heh-heh.


Your solution should provide scrollbars if the browser detects that
the content is larger than the window.
When you specify any window attribute, any that you don't specify
default to "off" instead of "on", so if you want to specify that
scrollbars are to appear, you also have to list all of the other
window attributes that you want:

window.open(search,
"somename",
"toolbar,location,directories,status,menubar,scrol lbars,resizable");

where "somename" must be unique if you're opening multiple windows.
That's the reason for the Math.random() business.

If you're not getting scrollbars by default, specifying them might
not create them either, since the browser doesn't think they're needed.
That may depend on which browser you're using.

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.