Browse Source

[fix] pep8 fix for faroo engine

misnyo 7 years ago
parent
commit
20d2d4dab1
1 changed files with 10 additions and 11 deletions
  1. 10
    11
      searx/engines/faroo.py

+ 10
- 11
searx/engines/faroo.py View File

24
 # search-url
24
 # search-url
25
 url = 'http://www.faroo.com/'
25
 url = 'http://www.faroo.com/'
26
 search_url = url + 'instant.json?{query}'\
26
 search_url = url + 'instant.json?{query}'\
27
-                      '&start={offset}'\
28
-                      '&length={number_of_results}'\
29
-                      '&l={language}'\
30
-                      '&src={categorie}'\
31
-                      '&i=false'\
32
-                      '&c=false'
27
+    '&start={offset}'\
28
+    '&length={number_of_results}'\
29
+    '&l={language}'\
30
+    '&src={categorie}'\
31
+    '&i=false'\
32
+    '&c=false'
33
 
33
 
34
 search_category = {'general': 'web',
34
 search_category = {'general': 'web',
35
                    'news': 'news'}
35
                    'news': 'news'}
79
     # parse results
79
     # parse results
80
     for result in search_res['results']:
80
     for result in search_res['results']:
81
         publishedDate = None
81
         publishedDate = None
82
-        result_json = {'url': result['url'],
83
-                        'title': result['title'],
84
-                        'content': result['kwic']}
82
+        result_json = {'url': result['url'], 'title': result['title'],
83
+                       'content': result['kwic']}
85
         if result['news']:
84
         if result['news']:
86
             result_json['publishedDate'] = \
85
             result_json['publishedDate'] = \
87
-                    datetime.datetime.fromtimestamp(result['date'] / 1000.0)
86
+                datetime.datetime.fromtimestamp(result['date'] / 1000.0)
88
 
87
 
89
         # append image result if image url is set
88
         # append image result if image url is set
90
         if result['iurl']:
89
         if result['iurl']:
91
-            result_json['template'] ='videos.html'
90
+            result_json['template'] = 'videos.html'
92
             result_json['thumbnail'] = result['iurl']
91
             result_json['thumbnail'] = result['iurl']
93
 
92
 
94
         results.append(result_json)
93
         results.append(result_json)