Browse Source

google engine: code cleanup

Dalf 10 years ago
parent
commit
fc0ae0f907
1 changed files with 3 additions and 19 deletions
  1. 3
    19
      searx/engines/google.py

+ 3
- 19
searx/engines/google.py View File

124
 # FIXME : no translation
124
 # FIXME : no translation
125
 property_address = "Address"
125
 property_address = "Address"
126
 property_phone = "Phone number"
126
 property_phone = "Phone number"
127
-property_location = "Location"
128
-property_website = "Web site"
129
-property_gplus_website = "Google plus"
130
 
127
 
131
 # cookies
128
 # cookies
132
 pref_cookie = ''
129
 pref_cookie = ''
166
         return url_string
163
         return url_string
167
 
164
 
168
 
165
 
169
-# URL : get label
170
-def url_get_label(url_string):
171
-    # sanity check
172
-    if url_string is None:
173
-        return url_string
174
-
175
-    # normal case
176
-    parsed_url = urlparse(url_string)
177
-    if parsed_url.netloc == 'plus.google.com':
178
-        return property_gplus_website
179
-    return property_website
180
-
181
-
182
 # returns extract_text on the first result selected by the xpath or None
166
 # returns extract_text on the first result selected by the xpath or None
183
 def extract_text_from_dom(result, xpath):
167
 def extract_text_from_dom(result, xpath):
184
     r = result.xpath(xpath)
168
     r = result.xpath(xpath)
281
                 # append result
265
                 # append result
282
                 results.append({'url': url,
266
                 results.append({'url': url,
283
                                 'title': title,
267
                                 'title': title,
284
-                                'content': content})
285
-        except Exception, e:
286
-            print e
268
+                                'content': content
269
+                                })
270
+        except:
287
             continue
271
             continue
288
 
272
 
289
     # parse suggestion
273
     # parse suggestion