Compare commits

...

2 commits

2 changed files with 3 additions and 6 deletions

View file

@ -1,12 +1,9 @@
"""Match OSM and Wikidata items.""" """Match OSM and Wikidata items."""
CallParams = dict[str, str | int] CallParams = dict[str, str | int]
user_agent = ( user_agent = (
"osm-wikidata/0.2" "osm-wikidata/0.2 (https://git.4angle.com/edward/owl-map; edward@4angle.com)"
+ " (https://github.com/EdwardBetts/osm-wikidata;"
+ " edward@4angle.com)"
) )

View file

@ -6,7 +6,7 @@ from collections import OrderedDict
import requests import requests
from . import CallParams from . import CallParams, user_agent_headers
Hit = dict[str, typing.Any] Hit = dict[str, typing.Any]
@ -28,7 +28,7 @@ def lookup_with_params(**kwargs: str) -> list[Hit]:
"polygon_text": 0, "polygon_text": 0,
} }
params.update(kwargs) params.update(kwargs)
r = requests.get(url, params=params) r = requests.get(url, params=params, headers=user_agent_headers())
if r.status_code == 500: if r.status_code == 500:
raise SearchError raise SearchError