.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.engines.fdroid Namespace Reference

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['files', 'apps']
 
bool paging = True
 
str base_url = 'https://search.f-droid.org/'
 
str search_url = base_url + '?{query}'
 

Detailed Description

 F-Droid (a repository of FOSS applications for Android)

Function Documentation

◆ request()

searx.engines.fdroid.request ( query,
params )

Definition at line 30 of file fdroid.py.

30def request(query, params):
31 query = urlencode({'q': query, 'page': params['pageno'], 'lang': ''})
32 params['url'] = search_url.format(query=query)
33 return params
34
35
36# get response from search-request

◆ response()

searx.engines.fdroid.response ( resp)

Definition at line 37 of file fdroid.py.

37def response(resp):
38 results = []
39
40 dom = html.fromstring(resp.text)
41
42 for app in dom.xpath('//a[@class="package-header"]'):
43 app_url = app.xpath('./@href')[0]
44 app_title = extract_text(app.xpath('./div/h4[@class="package-name"]/text()'))
45 app_content = (
46 extract_text(app.xpath('./div/div/span[@class="package-summary"]')).strip()
47 + ' - '
48 + extract_text(app.xpath('./div/div/span[@class="package-license"]')).strip()
49 )
50 thumbnail = app.xpath('./img[@class="package-icon"]/@src')[0]
51
52 results.append({'url': app_url, 'title': app_title, 'content': app_content, 'thumbnail': thumbnail})
53
54 return results

Variable Documentation

◆ about

dict searx.engines.fdroid.about
Initial value:
1= {
2 "website": 'https://f-droid.org/',
3 "wikidata_id": 'Q1386210',
4 "official_api_documentation": None,
5 "use_official_api": False,
6 "require_api_key": False,
7 "results": 'HTML',
8}

Definition at line 11 of file fdroid.py.

◆ base_url

str searx.engines.fdroid.base_url = 'https://search.f-droid.org/'

Definition at line 25 of file fdroid.py.

◆ categories

list searx.engines.fdroid.categories = ['files', 'apps']

Definition at line 21 of file fdroid.py.

◆ paging

bool searx.engines.fdroid.paging = True

Definition at line 22 of file fdroid.py.

◆ search_url

str searx.engines.fdroid.search_url = base_url + '?{query}'

Definition at line 26 of file fdroid.py.