.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
emojipedia.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: AGPL-3.0-or-later
2
"""Emojipedia
3
4
Emojipedia is an emoji reference website which documents the meaning and
5
common usage of emoji characters in the Unicode Standard. It is owned by Zedge
6
since 2021. Emojipedia is a voting member of The Unicode Consortium.[1]
7
8
[1] https://en.wikipedia.org/wiki/Emojipedia
9
"""
10
11
from
urllib.parse
import
urlencode
12
from
lxml
import
html
13
14
from
searx.utils
import
(
15
eval_xpath_list,
16
extract_text,
17
)
18
19
about = {
20
"website"
:
'https://emojipedia.org'
,
21
"wikidata_id"
:
'Q22908129'
,
22
"official_api_documentation"
:
None
,
23
"use_official_api"
:
False
,
24
"require_api_key"
:
False
,
25
"results"
:
'HTML'
,
26
}
27
28
categories = []
29
30
base_url =
'https://emojipedia.org'
31
search_url = base_url +
'/search?{query}'
32
33
34
def
request
(query, params):
35
params[
'url'
] = search_url.format(
36
query=urlencode({
'q'
: query}),
37
)
38
return
params
39
40
41
def
response
(resp):
42
results = []
43
44
dom = html.fromstring(resp.text)
45
46
for
result
in
eval_xpath_list(dom,
'//div[starts-with(@class, "EmojisList")]/a'
):
47
48
url = base_url + result.attrib.get(
'href'
)
49
res = {
'url'
: url,
'title'
: extract_text(result),
'content'
:
''
}
50
51
results.append(res)
52
53
return
results
searx.engines.emojipedia.response
response(resp)
Definition
emojipedia.py:41
searx.engines.emojipedia.request
request(query, params)
Definition
emojipedia.py:34
searx.utils
Definition
utils.py:1
searxng
searx
engines
emojipedia.py
Generated on Sat Nov 16 2024 00:10:57 for .oO SearXNG Developer Documentation Oo. by
1.12.0