summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorKirill Isakov <ukwt@ya.ru>2016-03-25 00:38:48 +0600
committerKirill Isakov <ukwt@ya.ru>2016-03-25 00:38:48 +0600
commit8b7dc2acb9f670ba65e4b98eb310f04e4c212bd8 (patch)
tree7e084da807052c86423804242ef0b0ecd3687028 /searx/engines
parentd748b8419ad1ef875f34783bbbcf773ebc4cfb5e (diff)
downloadsearxng-8b7dc2acb9f670ba65e4b98eb310f04e4c212bd8.tar.gz
searxng-8b7dc2acb9f670ba65e4b98eb310f04e4c212bd8.zip
Remove content field from ArchWiki results; reformat code in archlinux.py
Content field in Arch Wiki search results is of no real use, more often than not it contains no usable information and includes too many markup tags which make the text unreadable. It is safe to remove it.
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/archlinux.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/searx/engines/archlinux.py b/searx/engines/archlinux.py
index f12c4328a..84e0d0fba 100644
--- a/searx/engines/archlinux.py
+++ b/searx/engines/archlinux.py
@@ -3,12 +3,12 @@
"""
Arch Linux Wiki
- @website https://wiki.archlinux.org
- @provide-api no (Mediawiki provides API, but Arch Wiki blocks access to it
- @using-api no
- @results HTML
- @stable no (HTML can change)
- @parse url, title, content
+ @website https://wiki.archlinux.org
+ @provide-api no (Mediawiki provides API, but Arch Wiki blocks access to it
+ @using-api no
+ @results HTML
+ @stable no (HTML can change)
+ @parse url, title
"""
from urlparse import urljoin
@@ -26,7 +26,6 @@ base_url = 'https://wiki.archlinux.org'
# xpath queries
xpath_results = '//ul[@class="mw-search-results"]/li'
xpath_link = './/div[@class="mw-search-result-heading"]/a'
-xpath_content = './/div[@class="searchresult"]'
# cut 'en' from 'en_US', 'de' from 'de_CH', and so on
@@ -135,10 +134,8 @@ def response(resp):
link = result.xpath(xpath_link)[0]
href = urljoin(base_url, link.attrib.get('href'))
title = escape(extract_text(link))
- content = escape(extract_text(result.xpath(xpath_content)))
results.append({'url': href,
- 'title': title,
- 'content': content})
+ 'title': title})
return results