473,320 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Looking for multiple Googler script

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
3 1868
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paul Miller | last post by:
Some background first - we have some software that embeds a Python interpreter into a host application. Scripts are loaded dynamically and used. But we want to support the ability to edit scripts...
2
by: David Winter | last post by:
I'm not a developer myself, but I am looking for something that maybe one of you guys - has done - knows about - would like to do - yes, I have a small budget for this. :) The basic idea: A...
4
by: Matt Ratliff | last post by:
Hello, I would appreciate any assistance you have with the following problem: I have (as an example) an array of values as follows: arrayvalues=new Array("0001","0003","0005") where each is the...
6
by: Bob Alston | last post by:
I am looking for others who have built systems to scan documents, index them and then make them accessible from an Access database. My environment is a nonprofit with about 20-25 case workers who...
5
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
0
by: Fantasys | last post by:
We're seeking undiscovered unappreciated genius. E-mail me at django@kentuckyescorts.net Fantasys Enterprises the leader the USA Escort Industry is seeking developers to form the core of...
2
by: Arnaud | last post by:
Hello, I'm looking for a php multiple choice question script... Seen/tested many but no one with my requirements : - check boxes (and not only radio buttons) - show answers (optional) -...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.