Looking for multiple Googler script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Voetleuce en f?nsievry

    #1

    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+glos sary, searchterm+term s,
    searchterm+glos sary+site:.coun trycode (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&n um=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+sear chterm will yield the same result as
    searchterm+++++ searchterm or searchterm+++se archterm++), 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
  • Lee

    #2
    Re: Looking for multiple Googler script

    Voetleuce en f?nsievry said:[color=blue]
    >
    >G'day
    >
    >I'm looking for a script that can search multiple instances of Google[/color]

    <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.len gth;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(sea rch,
    ("window"+Math. random()).repla ce(/\./,""),
    "top="+(50*coun t)+",left="+(50 *count)
    );
    }
    }
    if(!count){ // nothing checked
    window.open(pre fix,("window"+M ath.random()).r eplace(/\./,""));
    }
    }
    </script>
    </head>
    <body>
    <form>
    <table>
    <tr>
    <td align="right">
    Search for:&nbsp;
    </td>
    <td>
    <input name="q">
    <input type="button" value="Go" onclick="go(thi s.form)">
    </td>
    </tr>
    <tr>
    <td align="right">
    With:&nbsp;
    </td>
    <td>
    <input type="checkbox" name="opt" value="terms">t erms
    <input type="checkbox" name="opt" value="glossary ">glossary
    <input type="checkbox" name="opt" value="site:">s ite:<input name="site">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    Comment

    • Voetleuce en f?nsievry

      #3
      Re: Looking for multiple Googler script

      Lee <REM0VElbspamtr ap@cox.net> wrote in message news:<bradc6059 q@drn.newsguy.c om>...
      [color=blue]
      > Voetleuce en f?nsievry said:[/color]
      [color=blue][color=green]
      > >G'day
      > >
      > >I'm looking for a script that can search multiple instances of Google[/color][/color]
      [color=blue]
      > <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.len gth;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(sea rch,
      > ("window"+Math. random()).repla ce(/\./,""),
      > "top="+(50*coun t)+",left="+(50 *count)
      > );
      > }
      > }
      > if(!count){ // nothing checked
      > window.open(pre fix,("window"+M ath.random()).r eplace(/\./,""));
      > }
      > }
      > </script>
      > </head>
      > <body>
      > <form>
      > <table>
      > <tr>
      > <td align="right">
      > Search for:&nbsp;
      > </td>
      > <td>
      > <input name="q">
      > <input type="button" value="Go" onclick="go(thi s.form)">
      > </td>
      > </tr>
      > <tr>
      > <td align="right">
      > With:&nbsp;
      > </td>
      > <td>
      > <input type="checkbox" name="opt" value="terms">t erms
      > <input type="checkbox" name="opt" value="glossary ">glossary
      > <input type="checkbox" name="opt" value="site:">s ite:<input name="site">
      > </td>
      > </tr>
      > </table>
      > </form>
      > </body>
      > </html>[/color]

      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(sea rch,
      ("window"+Math. random()).repla ce(/\./,""),
      "top="+(50*coun t)+",left="+(50 *count)
      );

      to

      window.open(sea rch);

      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.

      Comment

      • Lee

        #4
        Re: Looking for multiple Googler script

        Voetleuce en f?nsievry said:
        [color=blue]
        >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(se arch,
        > ("window"+Math. random()).repla ce(/\./,""),
        > "top="+(50*coun t)+",left="+(50 *count)
        >);
        >
        >to
        >
        >window.open(se arch);
        >
        >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.[/color]

        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(sea rch,
        "somename",
        "toolbar,locati on,directories, status,menubar, scrollbars,resi zable");

        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.

        Comment

        Working...