.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
apple_app_store.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: AGPL-3.0-or-later
2
"""Apple App Store
3
4
"""
5
6
from
json
import
loads
7
from
urllib.parse
import
urlencode
8
from
dateutil.parser
import
parse
9
10
about = {
11
"website"
:
'https://www.apple.com/app-store/'
,
12
"wikidata_id"
:
'Q368215'
,
13
"official_api_documentation"
: (
14
'https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/'
15
'iTuneSearchAPI/UnderstandingSearchResults.html#//apple_ref/doc/uid/TP40017632-CH8-SW1'
16
),
17
"use_official_api"
:
True
,
18
"require_api_key"
:
False
,
19
"results"
:
'JSON'
,
20
}
21
22
categories = [
'files'
,
'apps'
]
23
safesearch =
True
24
25
search_url =
'https://itunes.apple.com/search?{query}'
26
27
28
def
request
(query, params):
29
explicit =
"Yes"
30
31
if
params[
'safesearch'
] > 0:
32
explicit =
"No"
33
34
params[
'url'
] = search_url.format(query=urlencode({
'term'
: query,
'media'
:
'software'
,
'explicit'
: explicit}))
35
36
return
params
37
38
39
def
response
(resp):
40
results = []
41
42
json_result = loads(resp.text)
43
44
for
result
in
json_result[
'results'
]:
45
results.append(
46
{
47
'url'
: result[
'trackViewUrl'
],
48
'title'
: result[
'trackName'
],
49
'content'
: result[
'description'
],
50
'thumbnail'
: result[
'artworkUrl100'
],
51
'publishedDate'
: parse(result[
'currentVersionReleaseDate'
]),
52
'author'
: result[
'sellerName'
],
53
}
54
)
55
56
return
results
searx.engines.apple_app_store.response
response(resp)
Definition
apple_app_store.py:39
searx.engines.apple_app_store.request
request(query, params)
Definition
apple_app_store.py:28
searxng
searx
engines
apple_app_store.py
Generated on Sat Nov 16 2024 00:10:57 for .oO SearXNG Developer Documentation Oo. by
1.12.0