home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 November / Chip_2003-11_cd1.bin / software / dave / dqsd.exe / searches / gg.xml < prev    next >
Text File  |  2002-12-14  |  14KB  |  336 lines

  1. <search function="gg">
  2.   <name>Google</name>
  3.   <description>
  4.     Google is reputed to be the web's fastest and most versatile search engine.<br/>
  5.     <div class="helpboxDescLabels">Switches:</div>
  6.     <table class="helpboxDescTable">
  7.       <tr><td>/ifl</td><td> - </td><td>"I'm Feeling Lucky": Go directly to Google's top-ranked result.</td></tr>
  8.       <tr><td>/advanced</td><td> - </td><td>Use the Google Advanced Search page.</td></tr>
  9.       <tr><td>/groups</td><td> - </td><td>Search Google's newsgroup archive.</td></tr>
  10.       <tr><td>/directory</td><td> - </td><td>Search Google's copy of the DMOZ open directory.</td></tr>
  11.       <tr><td>/images</td><td> - </td><td>Search for images.</td></tr>
  12.       <tr><td>/news</td><td> - </td><td>Search for news (<i>warning : still in beta, .com/english only</i>).</td></tr>
  13.       <tr><td>/froogle</td><td> - </td><td>Find products for sale online(<i>warning : still in beta, .com/english only</i>).</td></tr>
  14.       <tr><td>/glossary</td><td> - </td><td>Find definitions for words, phrases and acronyms(<i>warning : still in beta, .com/english only</i>).</td></tr>
  15.       <tr><td>/keys</td><td> - </td><td>Navigate search results without using your mouse (<i>warning : still in beta, .com/english only</i>).</td></tr>
  16.       <tr><td>/since:days</td><td> - </td><td>Search pages based on when they were indexed.  Use either a number to specify when, or 
  17.         <div style="padding: 0 0 0 20px">
  18.           /since:t - indexed today<br/>   
  19.           /since:y - indexed yesterday<br/>   
  20.           /since:w - indexed in the last 7 days<br/>   
  21.           /since:m - indexed in the last 30 days   
  22.         </div> 
  23.       </td></tr>
  24.       <tr><td>/cache</td><td> - </td><td>Given a URL, loads Google's cached copy of the web page.</td></tr>
  25.       <tr><td>/related</td><td> - </td><td>Given a URL, finds other sites closely related.</td></tr>
  26.       <tr><td>/link</td><td> - </td><td>Given a URL, finds other sites that link to it.</td></tr>
  27.     </table>
  28.     <div class="helpboxDescLabels">Locales:</div>
  29.     <table class="helpboxDescTable">
  30.       <tr><td>/local</td><td> - </td><td>Limits search results to the specified locale.</td></tr>
  31.       <tr><td>/canada</td><td> - </td><td>Use the localized canadian version of Google.</td></tr>
  32.       <tr><td>/deutschland</td><td> - </td><td>Use the localized german version of Google.</td></tr>
  33.       <tr><td>/france</td><td> - </td><td>Use the localized french version of Google.</td></tr>
  34.       <tr><td>/italia</td><td> - </td><td>Use the localized italian version of Google.</td></tr>
  35.       <tr><td>/uk</td><td> - </td><td>Use the localized United Kingdom version of Google.</td></tr>
  36.     </table>
  37.     <div class="helpboxDescLabels">Language:</div>
  38.     <table class="helpboxDescTable">
  39.       <tr><td colspan="3">Display Google tips and messages in...</td></tr>
  40.       <tr><td>/language:de</td><td> - </td><td>german</td></tr>
  41.       <tr><td>/language:es</td><td> - </td><td>spanish</td></tr>
  42.       <tr><td>/language:fr</td><td> - </td><td>french</td></tr>
  43.       <tr><td>/language:it</td><td> - </td><td>italian</td></tr>
  44.       <tr><td colspan="3">and many more... see <a href="http://www.google.com/help/customize.html#displang" target="_new">www.google.com/help/customize.html#displang</a></td></tr>
  45.     </table>
  46.     <div class="helpboxDescLabels">Examples:</div>
  47.     <table class="helpboxDescTable">
  48.       <tr><td>gg dqsd /images</td></tr>
  49.       <tr><td>gg tony blair /uk /directory</td></tr>
  50.       <tr><td>gg /froogle cd clock radio</td></tr>
  51.       <tr><td>gg /glossary wrt</td></tr>
  52.     </table>
  53.   </description>
  54.   <category>Search the Web</category>
  55.   <link>http://www.google.com/</link>
  56.   <contributor>Ryan Edwards, David Bau, news and language switches by MLL</contributor>
  57.   
  58.   <form name="ggf"
  59.         action="http://www.google.com/search"
  60.         method="get">
  61.     <input type="hidden" name="hl" value=""/>
  62.     <input type="hidden" name="cat" value=""/>
  63.     <input type="hidden" name="meta" value=""/>
  64.     <input type="hidden" name="q"/>
  65.   </form>
  66.   
  67.   <form name="ggf_adv"
  68.         action="http://www.google.com/advanced_search"
  69.         method="get">
  70.     <input type="hidden" name="hl" value=""/>
  71.     <input type="hidden" name="q"/>
  72.   </form>
  73.   
  74.   <form name="ggf_ifl"
  75.         action="http://www.google.com/search"
  76.         method="get">
  77.     <input type="hidden" name="hl" value=""/>
  78.     <input type="hidden" name="q"/>
  79.     <input type="hidden" name="meta" value=""/>
  80.     <input type="hidden" name="btnI" value="I'm Feeling Lucky"/>
  81.   </form>
  82.   
  83.   <form name="ggf_image"
  84.         action="http://images.google.com/images"
  85.         method="get">
  86.     <input type="hidden" name="hl" value=""/>
  87.     <input type="hidden" name="q"/>
  88.   </form>
  89.   
  90.   <form name="ggf_groups"
  91.         action="http://groups.google.com/groups"
  92.         method="get">
  93.     <input type="hidden" name="hl" value=""/>
  94.     <input type="hidden" name="q"/>
  95.   </form>
  96.   
  97.   <form name="ggf_news"
  98.         action="http://news.google.com/news"
  99.         method="get">
  100.     <!-- commented out for test <input type="hidden" name="hl" value="en"/> -->
  101.     <input type="hidden" name="hl" value=""/>
  102.     <input type="hidden" name="q"/>
  103.   </form>
  104.   
  105.   <form name="ggf_fresh"
  106.         action="http://www.researchbuzz.com/cgi-bin/goofresh.cgi" 
  107.         method="get">
  108.     <input type="hidden" Name="query" />
  109.     <input type="hidden" name="datemod" value="0" />
  110.   </form>
  111.  
  112.   <form name="ggf_froogle"
  113.         method="get"
  114.         action="http://froogle.google.com/froogle">
  115.     <input type="hidden" name="q" value="" />
  116.   </form>
  117.  
  118.   <form name="ggf_glossary"
  119.         method="get"
  120.         action="http://labs.google.com/glossary">
  121.     <input type="hidden" name="q" value="" />
  122.   </form>
  123.  
  124.   <form name="ggf_keys"
  125.         method="get"
  126.         action="http://labs.google.com/cgi-bin/keys">
  127.     <input type="hidden" name="q" value="" />
  128.   </form>
  129.  
  130.   <script><![CDATA[
  131.     function gg(q)
  132.     //by MLL: warning : news service is still in beta stage, so URLs below may change
  133.     {
  134.       var args = parseArgs(q, "ifl, advanced, groups, directory, images, news, since, cache, related, link, froogle, glossary, keys, local, canada, deutschland, france, italia, uk, language");
  135.       var mode, local, local_meta = "", local_tld = "com", msglang = "";
  136.       
  137.       if( nullArgs( "gg", q ) ) return false;
  138.  
  139.       // Establish the locale and mode the search will run in.
  140.       if( args.switches.length > 0 )
  141.       {
  142.         for( var j=0; j<args.switches.length; j++ )
  143.         {
  144.           switch( args.switches[j].name )
  145.           {
  146.             case "canada": local_tld = "ca"; local_meta = "cr=countryCA"; break;
  147.             case "deutschland": local_tld = "de"; local_meta = "cr=countryDE"; break;
  148.             case "france": local_tld = "fr"; local_meta = "cr=countryFR"; break;
  149.             case "italia": local_tld = "it"; local_meta = "cr=countryIT"; break;
  150.             case "uk": local_tld = "co.uk"; local_meta = "cr=countryUK|countryGB"; break;
  151.             
  152.             case "local": local = true; break;
  153.             
  154.             case "language": msglang = args.switch_val["language"]; break;
  155.             case "since": break;
  156.             
  157.             default:
  158.               if(mode) // multiple 'modes' have been specified
  159.               { 
  160.                 nullArgs("gg","?"); 
  161.                 return false; 
  162.               } 
  163.               else
  164.                 mode = args.switches[j].name;
  165.               break;
  166.           }
  167.         }
  168.       }
  169.       
  170.       // Change the form data to use the correct locale
  171.       document.ggf.action = document.ggf_ifl.action = "http://www.google." + local_tld + "/search";
  172.       document.ggf_adv.action = "http://www.google." + local_tld + "/advanced_search";
  173.       document.ggf_image.action = "http://images.google." + local_tld + "/images";
  174.       document.ggf_groups.action = "http://groups.google." + local_tld + "/groups";
  175.       document.ggf_news.action = "http://news.google." + local_tld + "/news";
  176.       
  177.       // If the user specified to search localized content only, restrict it now.
  178.       if(local)
  179.         document.ggf.meta.value = document.ggf_ifl.meta.value = local_meta;
  180.       else
  181.         document.ggf.meta.value = document.ggf_ifl.meta.value = "";
  182.       
  183.       // No parameters, so go to the appropriate web page.
  184.       if( args.q == "" )
  185.       {
  186.         var googleURL = "http://www.google." + local_tld;
  187.         switch( mode )
  188.         {
  189.           case "ifl":       googleURL = "http://www.google." + local_tld + "/help/features.html#lucky"; break;
  190.           case "advanced":  googleURL = "http://www.google." + local_tld + "/advanced_search"; break;
  191.           case "images":    googleURL = "http://images.google." + local_tld; break;
  192.           case "directory": googleURL = "http://images.google." + local_tld + "/dirhp"; break;
  193.           case "groups":    googleURL = "http://www.google." + local_tld + "/grphp"; break;
  194.           case "news":      googleURL = "http://www.google." + local_tld + "/news"; break;
  195.           case "froogle":   googleURL = "http://froogle.google.com/froogle"; break;
  196.           case "glossary":  googleURL = "http://labs.google.com/glossary"; break;
  197.           case "keys":      googleURL = "http://labs.google.com/keys"; break;
  198.           default: 
  199.         }
  200.         openSearchWindow( googleURL ); 
  201.         return;
  202.       }
  203.       else
  204.       {
  205.         //apply the daterange specification
  206.         if( args.switch_val["since"] == "" )
  207.         {
  208.           nullArgs("gg","?");
  209.           return false;
  210.         }
  211.         if( typeof args.switch_val["since"] != "undefined" )
  212.         {
  213.           var today = new Date();
  214.           var todayj = julian(today.getYear(),today.getMonth()+1,today.getDate());
  215.           var deltadays;
  216.           switch ( args.switch_val["since"] )
  217.           {
  218.             case "t": deltadays = 0; break;
  219.             case "y": deltadays = 1; break;
  220.             case "w": deltadays = 7; break;
  221.             case "m": deltadays = 30; break;
  222.             default: deltadays = args.switch_val["since"]; break;
  223.            }
  224.           if( isNaN(deltadays) )
  225.           {
  226.             nullArgs("gg","?");
  227.             return false;
  228.           }
  229.           var sincej = todayj - deltadays;
  230.           args.q = args.q + " daterange:" + sincej + "-" + todayj;
  231.         }
  232.  
  233.         if( mode )
  234.         {
  235.           // Perform a validity check on the specified switch
  236.           if((mode == "related" || mode == "cache" || mode == "link") && !isURL(args.q))
  237.           {
  238.             nullArgs("gg","?"); 
  239.             return false;
  240.           }
  241.  
  242.           switch( mode )
  243.           {
  244.             case "ifl":
  245.               document.ggf_ifl.q.value = args.q;
  246.               document.ggf_ifl.hl.value = msglang;
  247.               submitForm(ggf_ifl);
  248.               break;
  249.             case "advanced":
  250.               document.ggf_adv.q.value = args.q;
  251.               document.ggf_adv.hl.value = msglang;
  252.               submitForm(ggf_adv);
  253.               break;
  254.             case "directory":
  255.               document.ggf.q.value = args.q;
  256.               document.ggf.hl.value = msglang;
  257.               document.ggf.cat.value = "gwd/Top";
  258.               submitForm(ggf);
  259.               break;
  260.             case "images":
  261.               document.ggf_image.q.value = args.q;
  262.               document.ggf_image.hl.value = msglang;
  263.               submitForm(ggf_image);
  264.               break;
  265.             case "related":
  266.               document.ggf.q.value="related:" + args.q;
  267.               document.ggf.hl.value = msglang;
  268.               document.ggf.cat.value = "";
  269.               submitForm(ggf);
  270.               break;
  271.             case "cache":
  272.               document.ggf.q.value="cache:" + args.q;
  273.               document.ggf.hl.value = msglang;
  274.               document.ggf.cat.value = "";
  275.               submitForm(ggf);
  276.               break;
  277.             case "link":
  278.               document.ggf.q.value="link:" + args.q;
  279.               document.ggf.hl.value = msglang;
  280.               document.ggf.cat.value = "";
  281.               submitForm(ggf);
  282.               break;
  283.             case "groups":
  284.               document.ggf_groups.q.value = args.q;
  285.               document.ggf_groups.hl.value = msglang;
  286.               submitForm(ggf_groups);
  287.               break;
  288.             case "news":
  289.               document.ggf_news.q.value = args.q;
  290.               document.ggf_news.hl.value = msglang;
  291.               submitForm(ggf_news);
  292.               break;
  293.             case "froogle":
  294.               document.ggf_froogle.q.value = args.q;
  295.               submitForm(ggf_froogle);
  296.               break;
  297.             case "glossary":
  298.               document.ggf_glossary.q.value = args.q;
  299.               submitForm(ggf_glossary);
  300.               break;
  301.             case "keys":
  302.               document.ggf_keys.q.value = args.q;
  303.               submitForm(ggf_keys);
  304.               break;
  305.           }
  306.         }
  307.         else
  308.         {
  309.           document.ggf.q.value = args.q;
  310.           document.ggf.hl.value = msglang;
  311.           document.ggf.cat.value = "";
  312.           submitForm(ggf);
  313.         }
  314.       }
  315.     }
  316.  
  317.     function julian(Y,M,D) {
  318.     //inspired from http://pacific.commerce.ubc.ca/xr/julian.html
  319.     //(did not check it toroughly, but seems to work)
  320.        with (Math) {
  321.          jd=367*Y-floor(7*(Y+floor((M+9)/12))/4)
  322.            -floor(3*(floor((Y+(M-9)/7)/100)+1)/4)
  323.            +floor(275*M/9)+D+1721028;
  324.        }
  325.        return jd;
  326.     }
  327.   ]]></script>
  328.  
  329.   <copyright>
  330.   Copyright (c) 2002 David Bau
  331.   Distributed under the terms of the
  332.   GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  333.   </copyright>
  334. </search>
  335.  
  336.