forked from zaclys/searxng
		
	[enh] return results instead of answers
This commit is contained in:
		
							parent
							
								
									9d08c81f47
								
							
						
					
					
						commit
						3f4cc2146c
					
				
					 1 changed files with 4 additions and 7 deletions
				
			
		|  | @ -3,7 +3,7 @@ from lxml import html | ||||||
| from searx.engines.xpath import extract_text | from searx.engines.xpath import extract_text | ||||||
| from searx.languages import language_codes | from searx.languages import language_codes | ||||||
| 
 | 
 | ||||||
| categories = [] | categories = ['general'] | ||||||
| url = 'http://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}' | url = 'http://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}' | ||||||
| weight = 100 | weight = 100 | ||||||
| 
 | 
 | ||||||
|  | @ -41,7 +41,6 @@ def request(query, params): | ||||||
| 
 | 
 | ||||||
| def response(resp): | def response(resp): | ||||||
|     results = [] |     results = [] | ||||||
|     answers = [] |  | ||||||
| 
 | 
 | ||||||
|     dom = html.fromstring(resp.text) |     dom = html.fromstring(resp.text) | ||||||
| 
 | 
 | ||||||
|  | @ -58,11 +57,9 @@ def response(resp): | ||||||
|                 to_results.append(to_result.text_content()) |                 to_results.append(to_result.text_content()) | ||||||
| 
 | 
 | ||||||
|         results.append({ |         results.append({ | ||||||
|             'answer': u'{0} - {1}'.format( |             'url': resp.url, | ||||||
|                 from_result.text_content(), |             'title': from_result.text_content(), | ||||||
|                 '; '.join(to_results) |             'content': '; '.join(to_results) | ||||||
|             ), |  | ||||||
|             'url': url |  | ||||||
|         }) |         }) | ||||||
| 
 | 
 | ||||||
|     return results |     return results | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 potato
						potato