.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
mwmbl.py
Go to the documentation of this file.
1# SPDX-License-Identifier: AGPL-3.0-or-later
2"""Mwmbl_ is a non-profit, ad-free, free-libre and free-lunch search engine with
3a focus on useability and speed.
4
5.. hint::
6
7 At the moment it is little more than an idea together with a proof of concept
8 implementation of the web front-end and search technology on a small index.
9 Mwmbl_ does not support regions, languages, safe-search or time range.
10 search.
11
12.. _Mwmbl: https://github.com/mwmbl/mwmbl
13
14"""
15
16from urllib.parse import urlencode
17
18about = {
19 "website": 'https://github.com/mwmbl/mwmbl',
20 "use_official_api": True,
21 "require_api_key": False,
22 "results": 'JSON',
23}
24paging = False
25categories = ['general']
26
27api_url = "https://api.mwmbl.org/api/v1"
28
29
30def request(query, params):
31 params['url'] = f"{api_url}/search/?{urlencode({'s': query})}"
32 return params
33
34
35def response(resp):
36 results = []
37
38 json_results = resp.json()
39
40 for result in json_results:
41 title_parts = [title['value'] for title in result['title']]
42 results.append(
43 {
44 'url': result['url'],
45 'title': ''.join(title_parts),
46 'content': result['extract'][0]['value'],
47 }
48 )
49
50 return results
request(query, params)
Definition mwmbl.py:30