Merge branch 'master' into fix-engine-suspend-time

This commit is contained in:
Noémi Ványi 2019-01-29 11:03:35 +01:00 committed by GitHub
commit 83342a2878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 48 deletions

View File

@ -1,44 +0,0 @@
"""
Asksteem (general)
@website https://asksteem.com/
@provide-api yes
@using-api yes
@results JSON (https://github.com/Hoxly/asksteem-docs/wiki)
@stable yes
@parse url, title, content
"""
from json import loads
from searx.url_utils import urlencode
# engine dependent config
categories = ['general']
paging = True
language_support = False
disabled = True
# search-url
search_url = 'https://api.asksteem.com/search?{params}'
result_url = 'https://steemit.com/@{author}/{title}'
# do search-request
def request(query, params):
url = search_url.format(params=urlencode({'q': query, 'pg': params['pageno']}))
params['url'] = url
return params
# get response from search-request
def response(resp):
json = loads(resp.text)
results = []
for result in json.get('results', []):
results.append({'url': result_url.format(author=result['author'], title=result['permlink']),
'title': result['title'],
'content': result['summary']})
return results

View File

@ -70,10 +70,6 @@ engines:
categories : science categories : science
timeout : 4.0 timeout : 4.0
- name : asksteem
engine : asksteem
shortcut : as
- name : base - name : base
engine : base engine : base
shortcut : bs shortcut : bs

View File

@ -295,6 +295,9 @@ def image_proxify(url):
if not request.preferences.get_value('image_proxy'): if not request.preferences.get_value('image_proxy'):
return url return url
if url.startswith('data:image/jpeg;base64,'):
return url
if settings.get('result_proxy'): if settings.get('result_proxy'):
return proxify(url) return proxify(url)