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

Functions

 request (query, params)
 
EngineResults response (resp)
 

Variables

str engine_type = "online"
 
bool language_support = False
 
list categories = ["news"]
 
bool paging = True
 
int page_size = 10
 
bool time_range_support = True
 
dict time_range_args = {"month": "pub_date:ultimi_30_giorni", "year": "pub_date:ultimo_anno"}
 
str search_api = "https://api.ilpost.org/search/api/site_search/?"
 
dict about
 

Detailed Description

Engine for Il Post, a largely independent online Italian newspaper.

To use this engine add the following entry to your engines
list in ``settings.yml``:

.. code:: yaml

  - name: il post
    engine: il_post
    shortcut: pst
    disabled: false

Function Documentation

◆ request()

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

Definition at line 41 of file il_post.py.

41def request(query, params):
42 query_params = {
43 "qs": query,
44 "pg": params["pageno"],
45 "sort": "date_d",
46 "filters": "ctype:articoli",
47 }
48
49 if params["time_range"]:
50 if params["time_range"] not in time_range_args:
51 return None
52 query_params["filters"] += f";{time_range_args.get(params['time_range'], 'pub_date:da_sempre')}"
53 params["url"] = search_api + urlencode(query_params)
54 return params
55
56

◆ response()

EngineResults searx.engines.il_post.response ( resp)

Definition at line 57 of file il_post.py.

57def response(resp) -> EngineResults:
58 res = EngineResults()
59 json_data = resp.json()
60
61 for result in json_data["docs"]:
62 res.add(
63 res.types.MainResult(
64 url=result["link"],
65 title=result["title"],
66 content=result.get("summary", ""),
67 thumbnail=result.get("image"),
68 )
69 )
70
71 return res

Variable Documentation

◆ about

dict searx.engines.il_post.about
Initial value:
1= {
2 "website": "https://www.ilpost.it",
3 "wikidata_id": "Q3792882",
4 "official_api_documentation": None,
5 "use_official_api": True,
6 "require_api_key": False,
7 "results": "JSON",
8 "language": "it",
9}

Definition at line 30 of file il_post.py.

◆ categories

list searx.engines.il_post.categories = ["news"]

Definition at line 21 of file il_post.py.

◆ engine_type

str searx.engines.il_post.engine_type = "online"

Definition at line 19 of file il_post.py.

◆ language_support

bool searx.engines.il_post.language_support = False

Definition at line 20 of file il_post.py.

◆ page_size

int searx.engines.il_post.page_size = 10

Definition at line 23 of file il_post.py.

◆ paging

bool searx.engines.il_post.paging = True

Definition at line 22 of file il_post.py.

◆ search_api

str searx.engines.il_post.search_api = "https://api.ilpost.org/search/api/site_search/?"

Definition at line 28 of file il_post.py.

◆ time_range_args

dict searx.engines.il_post.time_range_args = {"month": "pub_date:ultimi_30_giorni", "year": "pub_date:ultimo_anno"}

Definition at line 26 of file il_post.py.

◆ time_range_support

bool searx.engines.il_post.time_range_support = True

Definition at line 25 of file il_post.py.