[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    dot.kde.org/static/cgi
From:       Navindra Umanee <navindra () cs ! mcgill ! ca>
Date:       2005-06-21 4:04:08
Message-ID: 1119326648.055017.23816.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 427577 by navindra:

added dot/google co-branding


 M  +16 -10    google.cgi  


--- trunk/dot.kde.org/static/cgi/google.cgi #427576:427577
@@ -1,33 +1,39 @@
 #!/home/navindra/bin/ruby
 
+# Author:  Navindra Umanee <navindra@kde.org>
+# License: GNU LGPL
+
 require 'cgi'
 cgi = CGI.new
 
-num = 100
-must_have = ''
-must_not_have = ''
-exact_phrase = ''
-text = ''
+google        = 'http://www.google.com/custom'
+site          = 'sitesearch=dot.kde.org'
+num           = 'num=100'
+must_have     = 'as_oq='
+must_not_have = 'as_eq='
+exact_phrase  = 'as_epq='
+text          = 'as_q='
+custom        = 'cof=GALT%3A%23007400%3BS%3Ahttp%3A%2F%2Fdot.kde.org%2F%3BVLC%3A%2380 \
1A8A%3BAH%3Acenter%3BBGC%3A%23ffffff%3BLH%3A108%3BLC%3A%23191970%3BGFNT%3A%23333333%3B \
L%3Ahttp%3A%2F%2Fwww.kde.org%2Fdot%2FImages%2Fkdedotnews.gif%3BLW%3A287%3BT%3A%23ffffff%3BAWFID%3A0131a0dfcf1ae323%3B'
  
 if cgi['op'] == 'articles'
-   must_have = 'dept.'
+   must_have += 'dept.'
    #must_not_have = 'parent'
 end
 
 $SAFE = 3
 
-text = "#{cgi['body']}" 
+text += "#{cgi['body']}" 
 
 if not cgi['subject'].empty?
-   exact_phrase = "%22Articles+on+#{cgi['subject']}%22" 
+   exact_phrase += "%22Articles+on+#{cgi['subject']}%22" 
 end
 
 if not cgi['author'].empty?
-   exact_phrase += "+" if not exact_phrase.empty?
+   exact_phrase += "+" if not cgi['subject'].empty?
    exact_phrase += "%22Also+by+#{cgi['author']}%22"
 end
 
-google = "http://www.google.com/search?num=#{num}&as_sitesearch=dot.kde.org&as_epq=#{exact_phrase}&as_oq=#{must_have}&as_eq=#{must_not_have}&as_q=#{text}"
 +google = "#{google}?#{text}&#{exact_phrase}&#{must_have}&#{must_not_have}&#{num}&#{site}&#{custom}"
  
 puts "Location: #{google}"
 puts "Content-type: text/html"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic