summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorta <alt3753.7@gmail.com>2022-08-23 05:18:35 +0700
committerta <alt3753.7@gmail.com>2022-08-23 05:18:35 +0700
commit79d06509c13699dcf498cd8f048f76a71536a321 (patch)
tree73d0d1f936f17dd187f2b6d518bd375a8074104b /searx/engines
parentd22f4690106777aafc4f2d19e11ca0a4f802c2fa (diff)
downloadsearxng-79d06509c13699dcf498cd8f048f76a71536a321.tar.gz
searxng-79d06509c13699dcf498cd8f048f76a71536a321.zip
add tags as suggestions
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/9gag.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/searx/engines/9gag.py b/searx/engines/9gag.py
index 8fa909942..6482ca811 100644
--- a/searx/engines/9gag.py
+++ b/searx/engines/9gag.py
@@ -34,9 +34,9 @@ def request(query, params):
def response(resp):
results = []
- json_results = loads(resp.text)['data']['posts']
+ json_results = loads(resp.text)['data']
- for result in json_results:
+ for result in json_results['posts']:
result_type = result['type']
if result_type == 'Photo':
@@ -63,4 +63,8 @@ def response(resp):
}
)
+ if 'tags' in json_results:
+ for suggestion in json_results['tags']:
+ results.append({'suggestion': suggestion['key']})
+
return results