[or-cvs] [torflow/master 63/92] Added 'extra' field to search modes for holding extra query string parameters. + Ixquick preferences (50 results at once and no family filter)

mikeperry at torproject.org mikeperry at torproject.org
Sat Aug 21 05:14:00 UTC 2010


Author: John M. Schanck <john at anomos.info>
Date: Sat, 7 Aug 2010 18:14:08 -0400
Subject: Added 'extra' field to search modes for holding extra query string parameters. + Ixquick preferences (50 results at once and no family filter)
Commit: 0da0b1ad313cfc84c2284a74b06fea7b0384cae0

---
 NetworkScanners/ExitAuthority/soat.py        |    5 ++++-
 NetworkScanners/ExitAuthority/soat_config.py |   11 ++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/NetworkScanners/ExitAuthority/soat.py b/NetworkScanners/ExitAuthority/soat.py
index 7000efd..74f8c36 100755
--- a/NetworkScanners/ExitAuthority/soat.py
+++ b/NetworkScanners/ExitAuthority/soat.py
@@ -2007,7 +2007,10 @@ class SearchBasedTest:
       # search google for relevant pages
       # note: google only accepts requests from idenitified browsers
       host = self.search_mode["host"]
-      params = urllib.urlencode({self.search_mode["query"] : query})
+      qdict = {self.search_mode["query"] : query}
+      if "extra" in self.search_mode:
+        qdict.update(self.search_mode["extra"])
+      params = urllib.urlencode(qdict)
       search_path = '?' + params
       search_url = "http://"+host+search_path
 
diff --git a/NetworkScanners/ExitAuthority/soat_config.py b/NetworkScanners/ExitAuthority/soat_config.py
index c717a18..6411933 100644
--- a/NetworkScanners/ExitAuthority/soat_config.py
+++ b/NetworkScanners/ExitAuthority/soat_config.py
@@ -123,10 +123,15 @@ search_cookie_file="./search_cookies.lwp"
 # Leave these maps alone. Change the default_search_mode variable 
 # to what you want.
 # XXX: Make a bing search mode.
-yahoo_search_mode = {"host" : "search.yahoo.com", "query":"p", "filetype": "originurlextension:", "inurl":None, "class":"yschttl", "realtgt":"ourl", "useragent":False}
-google_search_mode = {"host" : "www.google.com", "query":"q", "filetype":"filetype:", "inurl":"inurl:", "class" : "l", "realtgt":"href", "useragent":True}
+yahoo_search_mode = {"host" : "search.yahoo.com", "query":"p", "filetype": "originurlextension:", \
+                      "inurl":None, "class":"yschttl", "realtgt":"ourl", "useragent":False, \
+                      "extra":[]}
+google_search_mode = {"host" : "www.google.com", "query":"q", "filetype":"filetype:", \
+                      "inurl":"inurl:", "class" : "l", "realtgt":"href", "useragent":True, \
+                      "extra":[]}
 ixquick_search_mode = {"host" : "ixquick.com/do/metasearch.pl", "query":"all_terms", "filetype":"title:", \
-                      "inurl":"url:", "class" : "title2", "realtgt":"href", "useragent":False}
+                      "inurl":"url:", "class" : "title2", "realtgt":"href", "useragent":False, \
+                      "extra":[("prfh","disable_family_filterEEE1N1Nnum_of_resultsEEE50N1Ndisable_video_family_filterEEE1N1N")]}
  
 # FIXME: This does not affect the ssl search.. Only Google has 
 # a working "inurl:" that allows you to pick the scheme to be https 
-- 
1.7.1




More information about the tor-commits mailing list