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

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['science', 'scientific publications']
 
bool paging = True
 
str base_url = "https://scholar.archive.org"
 
int results_per_page = 15
 

Detailed Description

Internet Archive scholar(science)

Function Documentation

◆ request()

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

Definition at line 24 of file internet_archive_scholar.py.

24def request(query, params):
25 args = {
26 "q": query,
27 "limit": results_per_page,
28 "offset": (params["pageno"] - 1) * results_per_page,
29 }
30 params["url"] = f"{base_url}/search?{urlencode(args)}"
31 params["headers"]["Accept"] = "application/json"
32 return params
33
34

◆ response()

searx.engines.internet_archive_scholar.response ( resp)

Definition at line 35 of file internet_archive_scholar.py.

35def response(resp):
36 results = []
37
38 json = resp.json()
39
40 for result in json["results"]:
41 publishedDate, content, doi = None, '', None
42
43 if result['biblio'].get('release_date'):
44 publishedDate = datetime.strptime(result['biblio']['release_date'], "%Y-%m-%d")
45
46 if len(result['abstracts']) > 0:
47 content = result['abstracts'][0].get('body')
48 elif len(result['_highlights']) > 0:
49 content = result['_highlights'][0]
50
51 if len(result['releases']) > 0:
52 doi = result['releases'][0].get('doi')
53
54 results.append(
55 {
56 'template': 'paper.html',
57 'url': result['fulltext']['access_url'],
58 'title': result['biblio'].get('title') or result['biblio'].get('container_name'),
59 'content': html_to_text(content),
60 'publisher': result['biblio'].get('publisher'),
61 'doi': doi,
62 'journal': result['biblio'].get('container_name'),
63 'authors': result['biblio'].get('contrib_names'),
64 'tags': result['tags'],
65 'publishedDate': publishedDate,
66 'issns': result['biblio'].get('issns'),
67 'pdf_url': result['fulltext'].get('access_url'),
68 }
69 )
70
71 return results

Variable Documentation

◆ about

dict searx.engines.internet_archive_scholar.about
Initial value:
1= {
2 "website": "https://scholar.archive.org/",
3 "wikidata_id": "Q115667709",
4 "official_api_documentation": "https://scholar.archive.org/api/redoc",
5 "use_official_api": True,
6 "require_api_key": False,
7 "results": "JSON",
8}

Definition at line 9 of file internet_archive_scholar.py.

◆ base_url

str searx.engines.internet_archive_scholar.base_url = "https://scholar.archive.org"

Definition at line 20 of file internet_archive_scholar.py.

◆ categories

list searx.engines.internet_archive_scholar.categories = ['science', 'scientific publications']

Definition at line 17 of file internet_archive_scholar.py.

◆ paging

bool searx.engines.internet_archive_scholar.paging = True

Definition at line 18 of file internet_archive_scholar.py.

◆ results_per_page

int searx.engines.internet_archive_scholar.results_per_page = 15

Definition at line 21 of file internet_archive_scholar.py.