.oO SearXNG Developer Documentation Oo.
|
Functions | |
get_imdb_url_id (imdb_item_id) | |
get_wikimedia_image_id (url) | |
get_external_url (url_id, item_id, alternative="default") | |
get_earth_coordinates_url (latitude, longitude, osm_zoom, alternative='default') | |
area_to_osm_zoom (area) | |
Variables | |
dict | IMDB_PREFIX_TO_URL_ID |
str | HTTP_WIKIMEDIA_IMAGE = 'http://commons.wikimedia.org/wiki/Special:FilePath/' |
searx.external_urls.area_to_osm_zoom | ( | area | ) |
Convert an area in km² into an OSM zoom. Less reliable if the shape is not round. logarithm regression using these data: * 9596961 -> 4 (China) * 3287263 -> 5 (India) * 643801 -> 6 (France) * 6028 -> 9 * 1214 -> 10 * 891 -> 12 * 12 -> 13 In WolframAlpha: >>> log fit {9596961,15},{3287263, 14},{643801,13},{6028,10},{1214,9},{891,7},{12,6} with 15 = 19-4 (China); 14 = 19-5 (India) and so on Args: area (int,float,str): area in km² Returns: int: OSM zoom or 19 in area is not a number
Definition at line 66 of file external_urls.py.
searx.external_urls.get_earth_coordinates_url | ( | latitude, | |
longitude, | |||
osm_zoom, | |||
alternative = 'default' ) |
Definition at line 56 of file external_urls.py.
searx.external_urls.get_external_url | ( | url_id, | |
item_id, | |||
alternative = "default" ) |
Return an external URL or None if url_id is not found. url_id can take value from data/external_urls.json The "imdb_id" value is automatically converted according to the item_id value. If item_id is None, the raw URL with the $1 is returned.
Definition at line 32 of file external_urls.py.
References searx.external_urls.get_imdb_url_id(), and searx.external_urls.get_wikimedia_image_id().
searx.external_urls.get_imdb_url_id | ( | imdb_item_id | ) |
Definition at line 19 of file external_urls.py.
Referenced by searx.external_urls.get_external_url().
searx.external_urls.get_wikimedia_image_id | ( | url | ) |
Definition at line 24 of file external_urls.py.
Referenced by searx.external_urls.get_external_url().
str searx.external_urls.HTTP_WIKIMEDIA_IMAGE = 'http://commons.wikimedia.org/wiki/Special:FilePath/' |
Definition at line 16 of file external_urls.py.
dict searx.external_urls.IMDB_PREFIX_TO_URL_ID |
Definition at line 9 of file external_urls.py.