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

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
str base_url = "https://findthatmeme.com/api/v1/search"
 
list categories = ['images']
 
bool paging = True
 

Detailed Description

FindThatMeme (Images)

Function Documentation

◆ request()

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

Definition at line 21 of file findthatmeme.py.

21def request(query, params):
22
23 start_index = (params["pageno"] - 1) * 50
24 data = {"search": query, "offset": start_index}
25 params["url"] = base_url
26 params["method"] = 'POST'
27 params['headers']['content-type'] = "application/json"
28 params['data'] = dumps(data)
29
30 return params
31
32

◆ response()

searx.engines.findthatmeme.response ( resp)

Definition at line 33 of file findthatmeme.py.

33def response(resp):
34 search_res = resp.json()
35 results = []
36
37 for item in search_res:
38 img = 'https://findthatmeme.us-southeast-1.linodeobjects.com/' + item['image_path']
39 thumb = 'https://findthatmeme.us-southeast-1.linodeobjects.com/thumb/' + item.get('thumbnail', '')
40 date = datetime.strptime(item["updated_at"].split("T")[0], "%Y-%m-%d")
41 formatted_date = datetime.utcfromtimestamp(date.timestamp())
42
43 results.append(
44 {
45 'url': item['source_page_url'],
46 'title': item['source_site'],
47 'img_src': img if item['type'] == 'IMAGE' else thumb,
48 'filesize': humanize_bytes(item['meme_file_size']),
49 'publishedDate': formatted_date,
50 'template': 'images.html',
51 }
52 )
53
54 return results

Variable Documentation

◆ about

dict searx.engines.findthatmeme.about
Initial value:
1= {
2 "website": 'https://findthatmeme.com',
3 "official_api_documentation": None,
4 "use_official_api": False,
5 "require_api_key": False,
6 "results": "JSON",
7}

Definition at line 8 of file findthatmeme.py.

◆ base_url

str searx.engines.findthatmeme.base_url = "https://findthatmeme.com/api/v1/search"

Definition at line 16 of file findthatmeme.py.

◆ categories

list searx.engines.findthatmeme.categories = ['images']

Definition at line 17 of file findthatmeme.py.

◆ paging

bool searx.engines.findthatmeme.paging = True

Definition at line 18 of file findthatmeme.py.