summaryrefslogtreecommitdiff
path: root/searx/engines/openstreetmap.py
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2014-12-16 15:01:05 +0100
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2014-12-16 15:01:05 +0100
commit5ae38bafdf06518b30d092d8b68d5a41f5539249 (patch)
tree15c1972172e49250bef728a91eed6df515e0dfd8 /searx/engines/openstreetmap.py
parent19b1cedc23e816f77f076b47555c577065f34f86 (diff)
downloadsearxng-5ae38bafdf06518b30d092d8b68d5a41f5539249.tar.gz
searxng-5ae38bafdf06518b30d092d8b68d5a41f5539249.zip
[enh] add photon engine
Diffstat (limited to 'searx/engines/openstreetmap.py')
-rw-r--r--searx/engines/openstreetmap.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/searx/engines/openstreetmap.py b/searx/engines/openstreetmap.py
index 36b6011e7..be775122a 100644
--- a/searx/engines/openstreetmap.py
+++ b/searx/engines/openstreetmap.py
@@ -9,20 +9,23 @@
# @parse url, title
from json import loads
+from searx.utils import searx_useragent
# engine dependent config
categories = ['map']
paging = False
# search-url
-url = 'https://nominatim.openstreetmap.org/search/{query}?format=json&polygon_geojson=1&addressdetails=1'
-
+base_url = 'https://nominatim.openstreetmap.org/search/{query}?format=json&polygon_geojson=1&addressdetails=1'
result_base_url = 'https://openstreetmap.org/{osm_type}/{osm_id}'
# do search-request
def request(query, params):
- params['url'] = url.format(query=query)
+ params['url'] = base_url.format(query=query)
+
+ # using searx User-Agent
+ params['headers']['User-Agent'] = searx_useragent()
return params